Skip to content

Commit 4726499

Browse files
committed
Update spec to include tag history endpoint
1 parent dd534be commit 4726499

1 file changed

Lines changed: 49 additions & 7 deletions

File tree

extensions/_oci.md

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Content-Type: application/json
7070

7171
This component is for endpoints relating to tag history operations on a repository.
7272

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).
73+
This endpoint returns the history of a tag, listing each manifest the tag has pointed to over time and each time the tag was deleted, in descending order by history entry timestamp (newest first).
7474

7575
Tag history MAY be retrieved with a standard `GET` as follows.
7676

@@ -81,7 +81,12 @@ GET /v2/<name>/_oci/tag-history/<tag>
8181
`<name>` is the namespace of the repository, and `<tag>` is the name of the tag whose history is being queried.
8282

8383
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.
84+
If the repository does not exist, the registry MUST return a `404 Not Found` response code.
85+
If the tag has no history, the registry MUST return a `404 Not Found` response code.
86+
Tag history SHOULD remain queryable after the tag is deleted.
87+
Deleted manifests MUST NOT be removed from tag history.
88+
History entries for deleted manifests MUST continue to include the descriptor fields recorded when the tag was assigned to the manifest.
89+
Tag history MAY be deleted after the repository is deleted.
8590

8691
Upon success, the response body MUST be a JSON array of descriptor objects in the following format:
8792

@@ -99,6 +104,15 @@ Content-Type: application/json
99104
"org.opencontainers.tag.created": "2026-05-04T03:02:01Z"
100105
}
101106
},
107+
{
108+
"mediaType": "application/vnd.oci.empty.v1+json",
109+
"digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
110+
"size": 2,
111+
"data": "e30=",
112+
"annotations": {
113+
"org.opencontainers.tag.deleted": "2026-05-03T03:02:01Z"
114+
}
115+
},
102116
{
103117
"mediaType": "application/vnd.oci.image.manifest.v1+json",
104118
"size": 1234,
@@ -110,9 +124,11 @@ Content-Type: application/json
110124
]
111125
```
112126

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).
127+
Results MUST be sorted in descending order by the history entry timestamp, which is either the `org.opencontainers.tag.created` annotation value or the `org.opencontainers.tag.deleted` annotation value (i.e. the most recent entry appears first).
128+
129+
Each descriptor object in the response MUST be either a manifest descriptor or a delete marker.
114130

115-
Each descriptor object in the response MUST include the following properties:
131+
Manifest descriptors MUST include the following properties:
116132

117133
- **`mediaType`** *string*, REQUIRED
118134

@@ -134,6 +150,32 @@ Each descriptor object in the response MUST include the following properties:
134150

135151
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.
136152

153+
Delete markers MUST be represented by the OCI empty descriptor and MUST include the following properties:
154+
155+
- **`mediaType`** *string*, REQUIRED
156+
157+
MUST be `application/vnd.oci.empty.v1+json`.
158+
159+
- **`digest`** *string*, REQUIRED
160+
161+
MUST be `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`.
162+
163+
- **`size`** *integer*, REQUIRED
164+
165+
MUST be `2`.
166+
167+
- **`data`** *string*, REQUIRED
168+
169+
MUST be `e30=`.
170+
171+
- **`annotations`** *map of strings*, REQUIRED
172+
173+
Annotations associated with the historical tag entry. MUST include:
174+
175+
- **`org.opencontainers.tag.deleted`** *string*, REQUIRED
176+
177+
The RFC 3339 timestamp at which the tag was deleted. Used as the sort key and as the cursor for time-based pagination.
178+
137179
##### Query Parameters
138180

139181
The following query parameters MAY be provided:
@@ -147,8 +189,8 @@ The following query parameters MAY be provided:
147189

148190
- **`before`** *string (RFC 3339 timestamp)*, OPTIONAL
149191

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.
192+
When provided, only entries whose history entry timestamp is strictly less than (i.e. older than) `before` will be returned.
193+
This is used for time-based pagination: pass the `org.opencontainers.tag.created` or `org.opencontainers.tag.deleted` value of the last entry returned in the previous response to retrieve the next page.
152194

153195
##### Pagination Example
154196

@@ -158,7 +200,7 @@ To fetch the first page of up to 10 results:
158200
GET /v2/<name>/_oci/tag-history/<tag>?n=10
159201
```
160202

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:
203+
To fetch the next page, pass the history entry timestamp of the last result from the prior response as the `before` parameter:
162204

163205
```HTTP
164206
GET /v2/<name>/_oci/tag-history/<tag>?n=10&before=2026-04-03T02%3A01%3A00Z

0 commit comments

Comments
 (0)