Critical response headers should have compliance tests

Open
#355 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
api, testing

Research direction

Locate the compliance tests covering the end-2, end-5, and end-6 endpoints, then read how existing response headers are asserted. Add coverage for the required Content-Type, Docker-Content-Digest, Content-Length, and Range values described in the issue. Done means compliant implementations missing these headers fail the tests.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
1.1k
Forks
260
Avg merge
3d 23h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opencontainers/distribution-spec

All issues in opencontainers/distribution-spec

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.