Skip to content

Commit 7278988

Browse files
committed
Initial PR to propose updates to tag listing
Signed-off-by: Jeff Carter <jeff.carter@docker.com>
1 parent 583e014 commit 7278988

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

spec.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,44 @@ The tags MUST be in lexical order.
559559

560560
When using the `last` query parameter, the `n` parameter is OPTIONAL.
561561

562+
Registries MAY support an enhanced tag listing experience when clients pass an `Accept` header value of
563+
`application/vnd.oci.image.index.v1+json`. If a registry supports this mode, they MUST support these additional query parameters:
564+
* `sort_by` - allowed values are `created_at`, `name`
565+
* `sort_order` - allowed values are `asc` and `desc`
566+
* `artifact_type` - Artifact types to include in response, can be specified multiple times. If not set, do not return artifacts.
567+
568+
The `last` query parameter MUST contain a value consistent with the specified `sort_by`.
569+
570+
The response MUST be a json body in the following format:
571+
```json
572+
{
573+
"schemaVersion": 2,
574+
"mediaType": "application/vnd.oci.image.index.v1+json",
575+
"manifests": [
576+
{
577+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
578+
"size": 1234,
579+
"digest": "sha256:a1a1a1...",
580+
"artifactType": "application/vnd.example.sbom.v1",
581+
"annotations": {
582+
"org.opencontainers.image.created": "2022-01-01T14:42:55Z",
583+
"org.opencontainers.image.ref.name": "<tag1>"
584+
}
585+
},
586+
{
587+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
588+
"size": 1234,
589+
"digest": "sha256:a2a2a2...",
590+
"artifactType": "application/vnd.example.signature.v1",
591+
"annotations": {
592+
"org.opencontainers.image.created": "2022-01-01T07:21:33Z",
593+
"org.opencontainers.image.ref.name": "<tag2>"
594+
}
595+
}
596+
]
597+
}
598+
```
599+
562600
_Implementers note:_
563601
Previous versions of this specification did not include the `Link` header.
564602
Clients depending on the number of tags returned matching `n` may prematurely stop pagination on registries using the `Link` header.

0 commit comments

Comments
 (0)