fix: include artifactType in OCI 1.1 signature referrer manifest (cherry-pick PR-4997 to release-2.6)#5002
Open
anithapriyanatarajan wants to merge 2 commits into
Conversation
Signed-off-by: Anitha Natarajan <anataraj@redhat.com> (cherry picked from commit dd7417d) Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-2.6 #5002 +/- ##
==============================================
Coverage ? 35.96%
==============================================
Files ? 218
Lines ? 12489
Branches ? 0
==============================================
Hits ? 4492
Misses ? 7284
Partials ? 713 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
This is the challenge with these backports, figuring out what's needed for CI that runs against scaffolding@main. You'll need to cherry pick #4970 in as well. |
…orkflow (sigstore#4970) Signed-off-by: Aaron Lew <64337293+aaronlew02@users.noreply.github.com> (cherry picked from commit 38f73bb)
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-pick of #4997 onto
release-2.6.Closes #4995
WriteSignaturesExperimentalOCIwas constructing the OCI 1.1 referrer manifest by marshalling a plainv1.Manifeststruct, which does not include the top-levelartifactTypefield required by the OCI 1.1 Image Manifest spec. As a result, signature referrer manifests uploaded via the experimental OCI path were missingartifactType, making them non-compliant and difficult to discover by tools that filter referrers by type.Fix: Replace the
json.Marshal(&m)+taggableManifestapproach with the existingreferrerManifestwrapper (already used byWriteReferrerandWriteAttestationsReferrer), which serializes the top-levelartifactTypefield correctly. The value isapplication/vnd.dev.cosign.artifact.sig.v1+json, consistent with whatociexperimental.ArtifactType("sig")already computed in the function.Adaptation from original:
rm.targetRef(d.Repository)is called without options, as therelease-2.6version oftargetRefdoes not accept variadic options (added later onmain). The fix is otherwise identical.Release Note
Fixed
WriteSignaturesExperimentalOCIto include the top-levelartifactTypefield (application/vnd.dev.cosign.artifact.sig.v1+json) in OCI 1.1 referrer manifests produced for signatures, aligning with the OCI 1.1 Image Manifest specification.Documentation
No documentation update required.