Skip to content

Commit 583e014

Browse files
authored
Merge pull request #563 from wking/clarify-referrer-tag-vs-digest-algorithm
spec: Clarify Referrers Tag Schema vs. alternative algorithms
2 parents 7872490 + e839150 commit 583e014

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

spec.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -721,14 +721,17 @@ A client querying the [referrers API](#listing-referrers) and receiving a `404 N
721721

722722
##### Referrers Tag Schema
723723

724-
```text
725-
<alg>-<ref>
726-
```
724+
The Referrers Tag associated with a [Content Digest](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md#digests) <sup>[apdx-3](#appendix)</sup> MUST match the Truncated Algorithm, a `-` character, and the Truncated Encoded section, with any characters not allowed by [`<reference>` tags](#pulling-manifests) replaced with `-`.
725+
The Truncated Algorithm associated with a Content Digest MUST match the digest's `algorithm` section truncated to 32 characters.
726+
The Truncated Encoded section associated with a Content Digest MUST match the digest's `encoded` section truncated to 64 characters.
727727

728-
- `<alg>`: the digest algorithm (e.g. `sha256` or `sha512`)
729-
- `<ref>`: the digest from the `subject` field (limit of 64 characters)
728+
For example, the following list maps `subject` field digests to Referrers Tags:
730729

731-
For example, a manifest with the `subject` field digest set to `sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` in the `registry.example.org/project` repository would have a descriptor in the referrers list at `registry.example.org/project:sha256-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`.
730+
| Digest | Truncated Algorithm | Truncated Encoded | Referrers Tag |
731+
| ------ | ------------------- | ----------------- | ------------- |
732+
| sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | sha256 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | sha256-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
733+
| sha512:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | sha512 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | sha512-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
734+
| test+algorithm+using+algorithm+separators+and+lots+of+characters+to+excercise+overall+truncation:alsoSome=InTheEncodedSectionToShowHyphenReplacementAndLotsAndLotsOfCharactersToExcerciseEncodedTruncation | test+algorithm+using+algorithm+s | alsoSome=InTheEncodedSectionToShowHyphenReplacementAndLotsAndLot | test-algorithm-using-algorithm-s-alsoSome-InTheEncodedSectionToShowHyphenReplacementAndLotsAndLot |
732735

733736
This tag should return an image index matching the expected response of the [referrers API](#listing-referrers).
734737
Maintaining the content of this tag is the responsibility of clients pushing and deleting image manifests that contain a `subject` field.

0 commit comments

Comments
 (0)