Skip to content

Commit

Permalink
Add data function for git interface and remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: John Kjell <[email protected]>
  • Loading branch information
jkjell committed Apr 10, 2024
1 parent dba3c39 commit 4e37a04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 5 additions & 0 deletions attestation/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var (
_ attestation.Attestor = &Attestor{}
_ attestation.Subjecter = &Attestor{}
_ attestation.BackReffer = &Attestor{}
_ GitAttestor = &Attestor{}
)

type GitAttestor interface {
Expand Down Expand Up @@ -243,6 +244,10 @@ func (a *Attestor) Attest(ctx *attestation.AttestationContext) error {
return nil
}

func (a *Attestor) Data() *Attestor {
return a
}

func (a *Attestor) Subjects() map[string]cryptoutil.DigestSet {
subjects := make(map[string]cryptoutil.DigestSet)
hashes := []cryptoutil.DigestValue{{Hash: crypto.SHA256}}
Expand Down
14 changes: 0 additions & 14 deletions attestation/slsa/slsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,27 +153,13 @@ func (p *Provenance) Attest(ctx *attestation.AttestationContext) error {
digest := make(map[string]string)
digest["sha1"] = gh.Data().JWT.Claims["sha"].(string)

// p.PbProvenance.BuildDefinition.ResolvedDependencies = append(
// p.PbProvenance.BuildDefinition.ResolvedDependencies,
// &v1.ResourceDescriptor{
// Name: gh.Data().ProjectUrl,
// Digest: digest,
// })

case gitlab.Name:
gl := attestor.Attestor.(gitlab.GitLabAttestor)
p.PbProvenance.RunDetails.Builder.Id = GLCBuilderId
p.PbProvenance.RunDetails.Metadata.InvocationId = gl.Data().PipelineUrl
digest := make(map[string]string)
digest["sha1"] = gl.Data().JWT.Claims["sha"].(string)

// p.PbProvenance.BuildDefinition.ResolvedDependencies = append(
// p.PbProvenance.BuildDefinition.ResolvedDependencies,
// &v1.ResourceDescriptor{
// Name: gl.Data().ProjectUrl,
// Digest: digest,
// })

// Material Attestors
case material.Name:
mats := attestor.Attestor.(material.MaterialAttestor).Materials()
Expand Down

0 comments on commit 4e37a04

Please sign in to comment.