You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OCI 1.1 specification for the "referrers" API states that, for the descriptors in the returned referrers index, The descriptors MUST include an artifactType field that is set to the value of the artifactType in the image manifest or index, if present and The descriptors MUST include annotations from the image manifest or index..
However, the current go-containerregistry library does not fulfill either of these requirements.
To Reproduce
For annotations:
Create a v1.Image with a non-empty annotations field and subject field and use remote.Write to write the image
Call remote.Referrers on the subject and examine the manifest entry
Current behavior is that the descriptor for the image from step 1 does not have an annotations field
For artifactType:
Create a v1.Image that specifies a value for the artifactType field (can be done by including this field in the output of the RawManifest() implementation of v1.Image) and subject field and use remote.Write to write the image
Call remote.Referrers on the subject and examine the manifest entry
Current behavior is that the artifactType field of the descriptor for the image from step 1 is set to the value of Config.MediaType
Expected behavior
For annotations:
The descriptor for image should have an annotations field that matches the annotations field of the image
For artifactType:
The descriptor for the image should have an artifactType value that matches the aritfactType field of the image
Additional context
Full text of the referrers specification:
Upon success, the response MUST be a JSON body with an image index containing a list of descriptors. The Content-Type header MUST be set to application/vnd.oci.image.index.v1+json. Each descriptor is of an image manifest or index in the same <name> namespace with a subject field that specifies the value of <digest>. The descriptors MUST include an artifactType field that is set to the value of the artifactType in the image manifest or index, if present. If the artifactType is empty or missing in the image manifest, the value of artifactType MUST be set to the config descriptor mediaType value. If the artifactType is empty or missing in an index, the artifactType MUST be omitted. The descriptors MUST include annotations from the image manifest or index. If a query results in no matching referrers, an empty manifest list MUST be returned.
GitHub has implemented an action that uses the referrers API to upload referrers using subjects, and it looks like their implementation properly does this (sets annotations and artifact types for referrer ImageIndex): actions/attest-build-provenance#73 (comment)
The text was updated successfully, but these errors were encountered:
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.
Describe the bug
The OCI 1.1 specification for the "referrers" API states that, for the descriptors in the returned referrers index,
The descriptors MUST include an artifactType field that is set to the value of the artifactType in the image manifest or index, if present
andThe descriptors MUST include annotations from the image manifest or index.
.However, the current
go-containerregistry
library does not fulfill either of these requirements.To Reproduce
For annotations:
v1.Image
with a non-emptyannotations
field andsubject
field and useremote.Write
to write the imageremote.Referrers
on the subject and examine the manifest entryannotations
fieldFor
artifactType
:v1.Image
that specifies a value for theartifactType
field (can be done by including this field in the output of theRawManifest()
implementation ofv1.Image
) andsubject
field and useremote.Write
to write the imageremote.Referrers
on the subject and examine the manifest entryartifactType
field of the descriptor for the image from step 1 is set to the value ofConfig.MediaType
Expected behavior
For annotations:
annotations
field that matches theannotations
field of the imageFor
artifactType
:artifactType
value that matches thearitfactType
field of the imageAdditional context
Full text of the referrers specification:
GitHub has implemented an action that uses the referrers API to upload referrers using subjects, and it looks like their implementation properly does this (sets annotations and artifact types for referrer ImageIndex): actions/attest-build-provenance#73 (comment)
The text was updated successfully, but these errors were encountered: