feat: add input atts to result summary

This commit is contained in:
mrjoelkamp
2024-10-07 13:36:30 -05:00
parent d58ce0c600
commit a686de72fd
6 changed files with 30 additions and 19 deletions

View File

@@ -124,7 +124,15 @@ func TestVSA(t *testing.T) {
assert.Equal(t, PassPolicyDir+"/policy.rego", attestationPredicate.Policy.DownloadLocation)
assert.Equal(t, "https://docker.com/official/policy/v0.1", attestationPredicate.Policy.URI)
// this is the digest of the policy file
assert.Equal(t, map[string]string{"sha256": "ae71defe3b9ecebdf4f939a396b68884d0cba3c2c9d78ce5e64146d9487b0ade"}, attestationPredicate.Policy.Digest)
assert.Equal(t, map[string]string{"sha256": "fe1d4973f3521009a3adec206946e12aae935a2aceeb1e01f52b5d4cb9de79a5"}, attestationPredicate.Policy.Digest)
assert.Greater(t, len(attestationPredicate.InputAttestations), 0)
for _, input := range attestationPredicate.InputAttestations {
require.NotEmpty(t, input.Digest)
digest, ok := input.Digest["sha256"]
assert.True(t, ok)
assert.NotEmpty(t, digest)
assert.Contains(t, []string{"application/vnd.in-toto.provenance+dsse", "application/vnd.in-toto.spdx+dsse"}, input.MediaType)
}
}
func TestVerificationFailure(t *testing.T) {