Skip to content

Commit

Permalink
Specify filters-applied response header
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <jason@chainguard.dev>
  • Loading branch information
imjasonh committed Feb 2, 2023
1 parent 067a0f5 commit d06de52
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ The `Link` header MUST be set according to [RFC5988](https://www.rfc-editor.org/

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/<name>/referrers/<digest>?artifactType=<mediaType>` <sup>[end-12b](#endpoints)</sup>.
If filtering is requested and applied, the response MUST include an annotation (`org.opencontainers.referrers.filtersApplied`) denoting that an `artifactType` filter was applied.
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 annotation MUST contain a comma separated list of applied filters.

Example request with filtering:
Expand All @@ -580,6 +580,7 @@ GET /v2/<name>/referrers/<digest>?artifactType=application/vnd.example.sbom.v1
Example response with filtering:

```json
OCI-Filters-Applied: artifactType
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
Expand All @@ -595,9 +596,6 @@ Example response with filtering:
}
}
],
"annotations": {
"org.opencontainers.referrers.filtersApplied": "artifactType"
}
}
```

Expand Down

0 comments on commit d06de52

Please sign in to comment.