Skip to content

Commit ba1f62d

Browse files
committed
Update spec to include tag history endpoint
1 parent ed885fa commit ba1f62d

1 file changed

Lines changed: 101 additions & 1 deletion

File tree

extensions/_oci.md

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ GET /v2/_oci/ext/discover
2323
Repository-level extensions may be discovered with a standard GET as follows.
2424

2525
```HTTP
26-
GET /v2/{name}/_oci/ext/discover
26+
GET /v2/<name>/_oci/ext/discover
2727
```
2828

2929
The base extension returns an array of supported extensions with details of the endpoints as shown below.
@@ -66,6 +66,106 @@ Content-Type: application/json
6666

6767
Enumeration of the endpoints provided on this registry (as not all "OPTIONAL" endpoints may be present in all registries)
6868

69+
### Component: `tag-history`
70+
71+
This component is for endpoints relating to tag history operations on a repository.
72+
73+
This endpoint returns the history of a tag, listing each manifest the tag has pointed to over time, in descending order by creation timestamp (newest first).
74+
75+
Tag history MAY be retrieved with a standard `GET` as follows.
76+
77+
```HTTP
78+
GET /v2/<name>/_oci/tag-history/<tag>
79+
```
80+
81+
`<name>` is the namespace of the repository, and `<tag>` is the name of the tag whose history is being queried.
82+
83+
A successful request MUST return a `200 OK` response code.
84+
If the tag or repository does not exist, the registry MUST return a `404 Not Found` response code.
85+
86+
Upon success, the response body MUST be a JSON array of descriptor objects in the following format:
87+
88+
```HTTP
89+
200 OK
90+
Content-Length: <length>
91+
Content-Type: application/json
92+
93+
[
94+
{
95+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
96+
"size": 1234,
97+
"digest": "sha256:a1a1a1...",
98+
"annotations": {
99+
"org.opencontainers.tag.created": "2026-05-04T03:02:01Z"
100+
}
101+
},
102+
{
103+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
104+
"size": 1234,
105+
"digest": "sha256:b2b2b2...",
106+
"annotations": {
107+
"org.opencontainers.tag.created": "2026-04-03T02:01:00Z"
108+
}
109+
}
110+
]
111+
```
112+
113+
Results MUST be sorted in descending order by the `org.opencontainers.tag.created` annotation value (i.e. the most recently created entry appears first).
114+
115+
Each descriptor object in the response MUST include the following properties:
116+
117+
- **`mediaType`** *string*, REQUIRED
118+
119+
The media type of the manifest this tag pointed to at that point in time.
120+
121+
- **`size`** *integer*, REQUIRED
122+
123+
The size in bytes of the manifest.
124+
125+
- **`digest`** *string*, REQUIRED
126+
127+
The digest of the manifest, in the form `<algorithm>:<encoded>`.
128+
129+
- **`annotations`** *map of strings*, REQUIRED
130+
131+
Annotations associated with the historical tag entry. MUST include:
132+
133+
- **`org.opencontainers.tag.created`** *string*, REQUIRED
134+
135+
The RFC 3339 timestamp at which the tag was assigned to this manifest. Used as the sort key and as the cursor for time-based pagination.
136+
137+
##### Query Parameters
138+
139+
The following query parameters MAY be provided:
140+
141+
- **`n`** *integer*, OPTIONAL
142+
143+
Specifies the maximum number of results to return.
144+
The registry MAY return fewer results than requested if fewer historical entries exist.
145+
When `n` is zero, this endpoint MUST return an empty array.
146+
When `n` is not specified, the registry MAY apply a default limit.
147+
148+
- **`before`** *string (RFC 3339 timestamp)*, OPTIONAL
149+
150+
When provided, only entries whose `org.opencontainers.tag.created` value is strictly less than (i.e. older than) `before` will be returned.
151+
This is used for time-based pagination: pass the `org.opencontainers.tag.created` value of the last entry returned in the previous response to retrieve the next page.
152+
153+
##### Pagination Example
154+
155+
To fetch the first page of up to 10 results:
156+
157+
```HTTP
158+
GET /v2/<name>/_oci/tag-history/<tag>?n=10
159+
```
160+
161+
To fetch the next page, pass the `org.opencontainers.tag.created` value of the last result from the prior response as the `before` parameter:
162+
163+
```HTTP
164+
GET /v2/<name>/_oci/tag-history/<tag>?n=10&before=2026-04-03T02%3A01%3A00Z
165+
```
166+
167+
When the returned array contains fewer entries than `n` (or is empty), the client has reached the end of the history.
168+
69169
## Code representations
70170

71171
Golang structures for these JSON structures is available at [`github.com/opencontainers/distribution-spec/specs-go/v1/extensions`](https://github.com/opencontainers/distribution-spec/tree/main/specs-go/v1/extensions/)

0 commit comments

Comments
 (0)