-
Notifications
You must be signed in to change notification settings - Fork 26
Add PutSignaturesWithFormat/GetSignaturesWithFormat to OCI layout #312
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
base: main
Are you sure you want to change the base?
Conversation
4c51aa2
to
f0391e0
Compare
Packit jobs failed. @containers/packit-build please check. |
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.
Note to self: previously containers/image#2934 (review) .
The The “Skopeo test” failures here look relevant, I’m not immediately sure (I’m afraid I didn’t yet read the updated version of this PR) whether they are bugs to be fixed here, or whether the tests will need to be adjusted. |
4a93cdd
to
ffcc126
Compare
This is the commit ffcc126 to fix the CI |
@mtrmac PTAL when you have a moment. thanks! |
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.
Thanks, and I apologize for the delay.
|
||
import ( | ||
"context" | ||
"encoding/json" |
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.
I’m afraid this is not documented anywhere, but the *_transport.go
files primarily deal with image references and naming; and because image identity is critical for preserving the users’ intent when verifying signatures, we want as good unit test coverage as possible for *_transport.go
.
That’s, in principle, an option, but it might be easier to move some of the helper functions to oci_src.go
or oci_dest.go
, where the unit test coverage requirements are much more pragmatic. E.g. getOCIDescriptorContents
seems to have a single caller outside of this file, so it can be moved closer to the caller; probably similarly for getBlob
and others.
Also, getManifestDescriptor
should have unit test coverage for the new code paths.
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.
I wanted to do that, but some functions are used in oci_src.go
and oci_dest.go
. To avoid cyclic dependency, I did this way.
getOCIDescriptorContents
is used in both src and dest after addressing #312 (comment)
getBlob
is used in getSigstoreAttachmentManifest
and getOCIDescriptorContents
, which are used in both src and dest.
I don't like putting everything in transport
either. If we have any idea to fix this complexity, I'm happy to change that.
Also, getManifestDescriptor should have unit test coverage for the new code paths.
👍
✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6394 |
22ecce9
to
ef0ced7
Compare
811a527
to
e61dbb7
Compare
e61dbb7
to
deb84cf
Compare
deb84cf
to
3ca53f4
Compare
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Refactor `digestPart` validation by replacing `Validate` with `Parse` for clarity and correctness Use signDesc MediaType to validate signature MIMEType. Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
…ntents Signed-off-by: Ayato Tokubi <[email protected]>
…teCandidates` and improving unused blob handling Remove redundant implementation in `ociImageDestination` Simplify error handling in putSignaturesToSigstoreAttachment logic Normalize error message for sigstore signature support in OCI layout Add comment clarifying manifest digest requirement in PutSignaturesWithFormat Clarify comment for `manifestDigest` field in `ociImageDestination` Signed-off-by: Ayato Tokubi <[email protected]>
…tSignaturesWithFormat Remove unused `impl.NoSignatures` from `ociImageSource` structure Simplify `GetSignaturesWithFormat` by removing redundant nil check for `instanceDigest` Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
Signed-off-by: Ayato Tokubi <[email protected]>
…improved readability and maintainability. Signed-off-by: Ayato Tokubi <[email protected]>
…d `getSigstoreAttachmentManifest` Signed-off-by: Ayato Tokubi <[email protected]>
3ca53f4
to
34020b5
Compare
Signed-off-by: Ayato Tokubi <[email protected]>
34020b5
to
f74ad30
Compare
@mtrmac I'd appreciate if you could give another round of review. |
This PR is copied from containers/image#2934 .
This PR adds PutSignaturesWithFormat/GetSignaturesWithFormat support to OCI layout.
The general idea is tag-based discovery, same as sigstore signature discovery.
It stores the signature with
annotation org.opencontainers.image.ref.name: "sha256-<hash>.sig"
, which can be used as a tag. https://specs.opencontainers.org/image-spec/image-layout/#IMAGE-SPEC-IMAGE-LAYOUT-19Fixes #186