-
Notifications
You must be signed in to change notification settings - Fork 33
Add support for verifying multiple artifacts #431
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
Conversation
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
… artifacts func Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
This looks great so far, nice work! I'll give it a more thorough pass when out of draft. |
… not included in the intoto statement Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
It would expand the scope of the pull request a bit, but I'm wondering if we should get rid of VerifySignatureWithArtifact
and VerifySignatureWithArtifactDigest
completely and just use VerifySignatureWithArtifacts
and VerifySignatureWithArtifactDigests
.
Technically those methods are part of a public API, but from some quick searching of various projects nobody is calling them directly (they're using things like WithArtifact
and WithArtifactDigest
to construct the policy).
Then we could also get rid of PolicyConfig
options like verifyArtifact
, artifact
, verifyArtifactDigest
, and artifactDigest
.
What do you think? We'd have to update more files (like pkg/verify/fuzz_test.go
) but I think it would actually simplify changes in other places. Just to be clear, we would retain WithArtifact
and WithArtifactDigest
as convenience functions.
Signed-off-by: Meredith Lancaster <[email protected]>
That sounds good for me. Should be easy to update tests. I'll keep |
Signed-off-by: Meredith Lancaster <[email protected]>
Signed-off-by: Meredith Lancaster <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary
Closes #363
This adds support for verifying multiple artifacts against in-toto statement subjects. I added
verify.WithArtifacts(artifacts []io.Reader)
andverify.WithArtifactDigests([]ArtifactDigest)
.To avoid creating nested for loops when checking for the presence of artifacts in the intoto statement, I utilized maps to store subjects stored in the statement by hash algorithm.
Release Note
Documentation