Skip to content

Commit dc18cea

Browse files
authored
Merge pull request #543 from sudo-bmitch/pr-digest-on-tag-push
Add digest-algorithm for non-canonical blob patches
2 parents ed40988 + eadf94b commit dc18cea

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

spec.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ When a manifest is rejected for this reason, it MUST result in one or more `MANI
226226

227227
There are two ways to push blobs: chunked or monolithic.
228228

229+
In each implementation, if the client provided digest is invalid or uses an unsupported algorithm, the registry SHOULD respond with a response code `400 Bad Request`.
230+
229231
#### Pushing a blob monolithically
230232

231233
There are two ways to push a blob monolithically:
@@ -330,6 +332,12 @@ The process remains unchanged for chunked upload, except that the post request M
330332
Content-Length: 0
331333
```
332334

335+
When pushing a blob with a digest algorithm other than `sha256`, the post request SHOULD include the `digest-algorithm` parameter:
336+
337+
`/v2/<name>/blobs/uploads/?digest-algorithm=<algorithm>` <sup>[end-4c](#endpoints)</sup>
338+
339+
Here, `<digest-algorithm>` is the algorithm the registry should use for the blob, e.g. `digest-algorithm=sha512`.
340+
333341
If the registry has a minimum chunk size, the `POST` response SHOULD include the following header, where `<size>` is the size in bytes (see the blob `PATCH` definition for usage):
334342

335343
```
@@ -835,6 +843,7 @@ This endpoint MAY be used for authentication/authorization purposes, but this is
835843
| end-3 | `GET` / `HEAD` | `/v2/<name>/manifests/<reference>` | `200` | `404` |
836844
| end-4a | `POST` | `/v2/<name>/blobs/uploads/` | `202` | `404` |
837845
| end-4b | `POST` | `/v2/<name>/blobs/uploads/?digest=<digest>` | `201`/`202` | `404`/`400` |
846+
| end-4c | `POST` | `/v2/<name>/blobs/uploads/?digest-algorithm=<algorithm>` | `201`/`202` | `404`/`400` |
838847
| end-5 | `PATCH` | `/v2/<name>/blobs/uploads/<reference>` | `202` | `404`/`416` |
839848
| end-6 | `PUT` | `/v2/<name>/blobs/uploads/<reference>?digest=<digest>` | `201` | `404`/`400`/`416` |
840849
| end-7a | `PUT` | `/v2/<name>/manifests/<reference>` | `201` | `404`/`413` |

0 commit comments

Comments
 (0)