distribution-spec icon indicating copy to clipboard operation
distribution-spec copied to clipboard

Critical response headers should have compliance tests

Open wyckster opened this issue 2 years ago • 0 comments

I was able to create a registry implementation that passes all the compliance tests, but still fails to work correctly with a docker push command on Docker for Windows. To me, this is a critical shortcoming of the compliance tests.

The missing functionality requires new unit tests to be written, to ensure a compliant implementation. The following behaviour is critical to for correct interoperation with the Docker for Windows engine.

end-2 required headers

The end-2 endpoint (GET /v2/<name>/blobs/<digest>) requires the following headers to be set in a compliant response:

  • Content-Type (to the content type as it was uploaded, e.g. application/octet-stream)
  • Docker-Content-Digest (to the digest of the blob)
  • Content-Length (to the length of the blob)

end-5 required headers

The end-5 endpoint (PATCH /v2/<name>/blobs/uploads/<reference>) requires the following headers to be set in a compliant response:

  • Range (and it must be set to the range that was uploaded e.g. 0-2072) The format of this value for this header should be described in the spec.

end-6 required headers

The end-6 endpoint (PUT /v2/<name>/blobs/uploads/<reference>) requires the following headers to be set in a compliant response:

  • Docker-Content-Digest (to the digest of the concatenated entity - the content provided by all PATCHes and the final PUT)

Implementations under compliance test that fail to provide valid response headers for these endpoints should fail a test.

wyckster avatar Oct 05 '22 07:10 wyckster