I have a question about the "Listing Referrers" section of the distribution-spec v1.1.0-rc3, which states that:
The registry SHOULD support filtering on artifactType. To fetch the list of referrers with a filter, perform a GET request to a path in the following format: /v2//referrers/?artifactType= end-12b. If filtering is requested and applied, the response MUST include a header OCI-Filters-Applied: artifactType denoting that an artifactType filter was applied. If multiple filters are applied, the header MUST contain a comma separated list of applied filters.
Example request with filtering:
GET /v2/<name>/referrers/<digest>?artifactType=application/vnd.example.sbom.v1
Example response with filtering:
OCI-Filters-Applied: artifactType
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 1234,
"digest": "sha256:a1a1a1...",
"artifactType": "application/vnd.example.sbom.v1",
"annotations": {
"org.opencontainers.artifact.created": "2022-01-01T14:42:55Z",
"org.example.sbom.format": "json"
}
}
],
}
Question
From the above statement, it appears that the value of the OCI-Filters-Applied header should be a hard-coded string artifactType, rather than the concrete artifact type (such as application/vnd.example.sbom.v1 in this example).
However, the conformance test checks the concrete artifact type (application/vnd.example.sbom.v1 in this example) instead of the string artifactType. This seems to contradict the spec.
|
// also check resp header "OCI-Filters-Applied: artifactType" denoting that an artifactType filter was applied |
|
if resp.Header().Get("OCI-Filters-Applied") != "" { |
|
Expect(len(index.Manifests)).To(Equal(2)) |
|
Expect(resp.Header().Get("OCI-Filters-Applied")).To(Equal(testRefArtifactTypeA)) |
Could someone please help clarify what the correct value of the OCI-Filters-Applied header should be? Should it be the hard-coded string artifactType or the concrete artifact type?
Thank you!
I have a question about the "Listing Referrers" section of the distribution-spec
v1.1.0-rc3, which states that:Question
From the above statement, it appears that the value of the
OCI-Filters-Appliedheader should be a hard-coded stringartifactType, rather than the concrete artifact type (such asapplication/vnd.example.sbom.v1in this example).However, the conformance test checks the concrete artifact type (
application/vnd.example.sbom.v1in this example) instead of the stringartifactType. This seems to contradict the spec.distribution-spec/conformance/03_discovery_test.go
Lines 323 to 326 in 42d2d6e
Could someone please help clarify what the correct value of the
OCI-Filters-Appliedheader should be? Should it be the hard-coded stringartifactTypeor the concrete artifact type?Thank you!