Repository navigation
feat: implement OCI Distribution Spec v1.1 referrers API - #1
Open
mostlikelee wants to merge 18 commits into
Open
mostlikelee wants to merge 18 commits into
mostlikelee wants to merge 18 commits into
Conversation
Signed-off-by: Alistair Bush <alistair.bush@gmail.com> Co-authored-by: Alistair Bush <alistair.bush@gmail.com> Co-authored-by: Bracken Dawson <abdawson@gmail.com> Signed-off-by: lemonprogis <edward.briggler@gmail.com> Signed-off-by: Edward Briggler <edward.briggler@gmail.com> (cherry picked from commit 12fbb32)
Signed-off-by: Alistair Bush <alistair.bush@gmail.com> Signed-off-by: lemonprogis <edward.briggler@gmail.com> Signed-off-by: Edward Briggler <edward.briggler@gmail.com> (cherry picked from commit 005e12a)
Signed-off-by: Alistair Bush <alistair.bush@gmail.com> Signed-off-by: lemonprogis <edward.briggler@gmail.com> Signed-off-by: Edward Briggler <edward.briggler@gmail.com> (cherry picked from commit e4ffc83)
Signed-off-by: Alistair Bush <alistair.bush@gmail.com> Signed-off-by: lemonprogis <edward.briggler@gmail.com> Signed-off-by: Edward Briggler <edward.briggler@gmail.com> (cherry picked from commit 2db525d)
…{digest})
Completes the referrers API per OCI Distribution Spec v1.1 by adding
the read-side endpoint on top of the storage-layer subject linking from
the previous commits.
- Register GET /v2/{name}/referrers/{digest} route
- Implement referrersHandler returning an OCI Image Index response
- Enumerate referrer links from the filesystem storage layer
- Enrich descriptors with mediaType, artifactType, and annotations
from the manifest blob per spec requirements
- Support ?artifactType= query parameter filtering with
OCI-Filters-Applied response header
- Return empty index (not 404) when no referrers exist
- Add comprehensive TestReferrersAPI covering unfiltered listing,
artifact type filtering, non-matching filters, and empty results
Signed-off-by: lemonprogis <edward.briggler@gmail.com>
Signed-off-by: Edward Briggler <edward.briggler@gmail.com>
(cherry picked from commit 25ad9d0)
- Rename emptyJsonDescriptor to emptyJSONDescriptor (staticcheck ST1003) - Regenerate docs/content/spec/api.md from template to include the referrers route Signed-off-by: Edward Briggler <edward.briggler@gmail.com> Signed-off-by: lemonprogis <edward.briggler@gmail.com> (cherry picked from commit 3e01322)
Signed-off-by: Tim Lee <tim.lee@defenseunicorns.com>
Use the same tree as the verified rebase onto the upstream v3.1.3 tag. Keep the existing Referrers and manifest read-fix commits in history.
Signed-off-by: lemonprogis <edward.briggler@gmail.com> (cherry picked from commit 36748b8)
Signed-off-by: lemonprogis <edward.briggler@gmail.com> (cherry picked from commit 7a6b069)
Signed-off-by: lemonprogis <edward.briggler@gmail.com> (cherry picked from commit baceb84)
Signed-off-by: lemonprogis <edward.briggler@gmail.com> (cherry picked from commit fade04f)
Signed-off-by: lemonprogis <edward.briggler@gmail.com> (cherry picked from commit 28a817e)
mostlikelee
marked this pull request as ready for review
December 4, 2026 20:07
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
Implements the OCI Distribution Spec v1.1 referrers API (
GET /v2/{name}/referrers/{digest}), completing the work started in #3834 and #4483.This builds on the storage-layer subject linking by @brackendawson and @alistair (cherry-picked from #4483) and adds the read-side endpoint that was left as TODO.
What's included
From #4483 (storage layer — @brackendawson, @alistair):
subjectandartifactTypefields on OCI manifest and index PUT_referrers/subject.mediaTypeis a manifest typeNew (referrers API endpoint):
GET /v2/{name}/referrers/{digest}routeapplication/vnd.oci.image.index.v1+json) with descriptors for all manifests referencing the subjectmediaType,artifactType, andannotationsfrom the manifest blob per specartifactTypeper spec: manifest field →config.mediaTypefallback?artifactType=query parameter filtering withOCI-Filters-Appliedresponse headerTests
TestReferrersAPI— end-to-end test covering:Spec references
Related PRs