Skip to content

Commit

Permalink
Merge pull request #1073 from lcarva/RHTAPBUGS-857
Browse files Browse the repository at this point in the history
Relax the SLSA Provenance schema validation
  • Loading branch information
lcarva authored Oct 4, 2023
2 parents 8753956 + 14d1f31 commit 0119879
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
10 changes: 0 additions & 10 deletions pkg/schema/__snapshots__/slsa_provenance_v0.2_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -269,21 +269,11 @@

[TestPredicateInvocationConfigSourceUri/case_1 - 1]
[]jsonschema.KeyError{
{
PropertyPath: "/predicate/invocation/configSource/uri",
InvalidValue: "",
Message: "invalid uri: uri missing scheme prefix",
},
}
---

[TestPredicateInvocationConfigSourceUri/case_2 - 1]
[]jsonschema.KeyError{
{
PropertyPath: "/predicate/invocation/configSource/uri",
InvalidValue: "not_uri",
Message: "invalid uri: uri missing scheme prefix",
},
}
---

Expand Down
3 changes: 1 addition & 2 deletions pkg/schema/slsa_provenance_v0.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
"type": "object",
"properties": {
"uri": {
"type": "string",
"format": "uri"
"type": "string"
},
"digest": {
"$ref": "#/$defs/DigestSet"
Expand Down
1 change: 1 addition & 0 deletions pkg/schema/slsa_provenance_v0.2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func TestPredicateBuilderType(t *testing.T) {
func TestPredicateInvocationConfigSourceUri(t *testing.T) {
check(t,
`{"predicate": {"invocation": {"configSource": {"uri": null}}}}`, // is optional, so `null` is allowed
// Values without a scheme are currently allowed due to https://github.com/tektoncd/chains/issues/934.
`{"predicate": {"invocation": {"configSource": {"uri": ""}}}}`,
`{"predicate": {"invocation": {"configSource": {"uri": "not_uri"}}}}`,
`{"predicate": {"invocation": {"configSource": {"uri": "scheme:authority"}}}}`,
Expand Down

0 comments on commit 0119879

Please sign in to comment.