Skip to content

Commit 5366d1f

Browse files
committed
annotations: restrict character set of ref.name values
URI are standard enough, though % opens it a bit too much. After much discussion we're going to keep it as close to the docker tag as possible but with +, @ and / reference: opencontainers#671 (comment) And rather than making up our own mock grammar, lean on more formal EBNF. Fixes opencontainers#599 Signed-off-by: Vincent Batts <[email protected]>
1 parent 47238a2 commit 5366d1f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

annotations.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,25 @@ This specification defines the following annotation keys, intended for but not l
2828
* **org.opencontainers.image.revision** Source control revision identifier for the packaged software.
2929
* **org.opencontainers.image.vendor** Name of the distributing entity, organization or individual.
3030
* **org.opencontainers.image.licenses** License(s) under which contained software is distributed as an [SPDX License Expression][spdx-license-expression].
31-
* **org.opencontainers.image.ref.name** Name of the reference for a target (string). SHOULD only be considered valid when on descriptors on `index.json` within [image layout](image-layout.md).
31+
* **org.opencontainers.image.ref.name** Name of the reference for a target (string).
32+
* SHOULD only be considered valid when on descriptors on `index.json` within [image layout](image-layout.md).
33+
* Character set of the value SHOULD conform to alphanum of `A-Za-z0-9` and separator set of `-._:@/+`
34+
* An EBNF grammar like:
35+
```EBNF
36+
letter = "A" | "B" | "C" | "D" | "E" | "F" | "G"
37+
| "H" | "I" | "J" | "K" | "L" | "M" | "N"
38+
| "O" | "P" | "Q" | "R" | "S" | "T" | "U"
39+
| "V" | "W" | "X" | "Y" | "Z" | "a" | "b"
40+
| "c" | "d" | "e" | "f" | "g" | "h" | "i"
41+
| "j" | "k" | "l" | "m" | "n" | "o" | "p"
42+
| "q" | "r" | "s" | "t" | "u" | "v" | "w"
43+
| "x" | "y" | "z" ;
44+
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
45+
alphanum = letter | digit, { letter | digit } ;
46+
separator = "-" | "." | "_" | ":" | "@" | "+" | "--" ;
47+
component = alphanum, { separator | alphanum, alphanum } ;
48+
ref = component, { "/", component } ;
49+
```
3250
* **org.opencontainers.image.title** Human-readable title of the image (string)
3351
* **org.opencontainers.image.description** Human-readable description of the software packaged in the image (string)
3452

0 commit comments

Comments
 (0)