-
Notifications
You must be signed in to change notification settings - Fork 556
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
fix handling of verify-attestation types for URIs #2159
Conversation
Signed-off-by: Akira Saso <sasoakira6114@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #2159 +/- ##
==========================================
- Coverage 26.28% 26.26% -0.02%
==========================================
Files 130 130
Lines 7602 7615 +13
==========================================
+ Hits 1998 2000 +2
- Misses 5347 5359 +12
+ Partials 257 256 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Looks good! Maybe we could add a quick test for this? /~https://github.com/sigstore/cosign/blob/main/test/e2e_test.go
Thanks for your review! I'll try. |
97ca4aa
to
599f13e
Compare
Signed-off-by: Akira Saso <sasoakira6114@gmail.com>
Signed-off-by: Akira Saso <sasoakira6114@gmail.com>
599f13e
to
fee1370
Compare
I have added a test to verify URI-type attestation.
I am not familiar with CUE, but I noticed the following behavior. When the correct path and correct value, the command pass.
When the correct path and wrong value, the command don't pass.
When the wrong path, the command pass.
The data path used in goodCue was wrong, so the test passed. payload{
"_type": "https://in-toto.io/Statement/v0.1",
"predicateType": "https://cyclonedx.org/schema",
"subject": [
{
"name": "127.0.0.1:59647/cosign-attest-cyclonedx-e2e-image",
"digest": {
"sha256": "731a9ea8309ada1d7c57abb3cbe018c629e5202fe94c42d1a19bd70aaf6f4c8a"
}
}
],
"predicate": {
"Data": {
"bomFormat": "CycloneDX",
"components": [],
"dependencies": [],
"metadata": {},
"serialNumber": "urn:uuid:9b0c2427-be94-439c-82e5-8928db124270",
"specVersion": "1.4",
"version": 1
},
"Timestamp": ""
}
} |
* fix handling of verify-attestation types for URIs Signed-off-by: Akira Saso <sasoakira6114@gmail.com> * test: add a test to verify URI-type attestation Signed-off-by: Akira Saso <sasoakira6114@gmail.com> * test: fix cue used in verify-attstation Signed-off-by: Akira Saso <sasoakira6114@gmail.com> Signed-off-by: Akira Saso <sasoakira6114@gmail.com>
Signed-off-by: Akira Saso sasoakira6114@gmail.com
Summary
Close #2158
Please feel free to close the PR if there is any requirement on verify-attestation.
I made an attestation with URI specified as the following command.
Reviews can test this PR.
$ COSIGN_EXPERIMENTAL=1 cosign verify-attestation --type "https://example.com/TestResult/v1" otms61/test-custom-attest
before
after
Release Note
Documentation