Skip to content

Commit

Permalink
[attest] Fix spdx generation by passing through correct attestation
Browse files Browse the repository at this point in the history
type.

Previously our attestation type validation was converting the simple
type to the full predicate URL (e.g. spdx -> https://spdx.dev/Document).
This removes that tranformation so we're passing the right value to
GenerateAttestation.

Signed-off-by: Billy Lynch <billy@chainguard.dev>
  • Loading branch information
wlynch committed Oct 21, 2022
1 parent 6a3b4aa commit 63a3ea8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/gitsign-attest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ func main() {
flag.Parse()
ctx := context.Background()

at, err := options.ParsePredicateType(*attType)
if err != nil {
// Don't try to take the value - this will try to convert the short-form attestation type to it's
// full predicate URI.
if _, err := options.ParsePredicateType(*attType); err != nil {
log.Fatal(err)
}

Expand Down Expand Up @@ -85,6 +86,6 @@ func main() {

attestor := attest.NewAttestor(repo, sv, cosign.TLogUploadInTotoAttestation)

out, err := attestor.WriteFile(ctx, refName, sha, *path, at)
out, err := attestor.WriteFile(ctx, refName, sha, *path, *attType)
fmt.Println(out, err)
}

0 comments on commit 63a3ea8

Please sign in to comment.