Skip to content

Commit

Permalink
Try to gracefully handle gitlab jwt
Browse files Browse the repository at this point in the history
Signed-off-by: John Kjell <[email protected]>
  • Loading branch information
jkjell committed Apr 19, 2024
1 parent bb842ee commit 5ae979c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion attestation/slsa/slsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ func (p *Provenance) Attest(ctx *attestation.AttestationContext) error {
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)

sha, found := gl.Data().JWT.Claims["sha"]
if found {
digest["sha1"] = sha.(string)
} else {
log.Warn("No SHA found in GitLab JWT")
}

// Material Attestors
case material.Name:
Expand Down

0 comments on commit 5ae979c

Please sign in to comment.