Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using deprecated in_toto.ProvenanceStatement #3243

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cosign/attestation/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func generateSLSAProvenanceStatementSLSA02(rawPayload []byte, digest string, rep
if err != nil {
return "", fmt.Errorf("unmarshal Provenance predicate: %w", err)
}
return in_toto.ProvenanceStatement{
return in_toto.ProvenanceStatementSLSA02{
StatementHeader: generateStatementHeader(digest, repo, slsa02.PredicateSLSAProvenance),
Predicate: predicate,
}, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/cosign/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func appendSlices(slices [][]byte) []byte {
}

func Test_verifyOCIAttestation(t *testing.T) {
stmt, err := json.Marshal(in_toto.ProvenanceStatement{})
stmt, err := json.Marshal(in_toto.ProvenanceStatementSLSA02{})
if err != nil {
t.Fatal(err)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/policy/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ func AttestationToPayloadJSON(_ context.Context, predicateType string, verifiedA
return nil, statement.PredicateType, fmt.Errorf("marshaling LinkStatement: %w", err)
}
case options.PredicateSLSA:
var slsaProvenanceStatement in_toto.ProvenanceStatement
var slsaProvenanceStatement in_toto.ProvenanceStatementSLSA02
if err := json.Unmarshal(decodedPayload, &slsaProvenanceStatement); err != nil {
return nil, statement.PredicateType, fmt.Errorf("unmarshaling ProvenanceStatement): %w", err)
return nil, statement.PredicateType, fmt.Errorf("unmarshaling ProvenanceStatementSLSA02): %w", err)
}
payload, err = json.Marshal(slsaProvenanceStatement)
if err != nil {
return nil, statement.PredicateType, fmt.Errorf("marshaling ProvenanceStatement: %w", err)
return nil, statement.PredicateType, fmt.Errorf("marshaling ProvenanceStatementSLSA02: %w", err)
}
case options.PredicateSPDX, options.PredicateSPDXJSON:
var spdxStatement in_toto.SPDXStatement
Expand Down
Loading