Skip to content

Commit 8dafd00

Browse files
MVrachevjoshuagltrishankatdatadogmnm678
authored
Clarify optional attributes (#165)
* Clarify that delegations are optional Nowhere in the spec, we clarify that "delegations" is an optional field in the targets metadata file. This is a possible reason why (at the time of writing this commit) in the TUF python reference implementation "delegations" is still a required field. Signed-off-by: Martin Vrachev <[email protected]> * Make CONSISTENT_SNAPSHOT optional From chapter 6.2.1 in the tuf specification (version 1.019) "Finally, the root metadata should write the Boolean "consistent_snapshot" attribute at the root level of its keys of attributes. If consistent snapshots are not written by the repository, then the attribute may either be left unspecified or be set to the False value. Otherwise, it must be set to the True value." The above implies that there could be repositories with root metadata without CONSISTENT_SNAPSHOT. Clarify that, but phrase it so it's clear this should be included in new implementations. For context: https://theupdateframework.github.io/specification/latest/index.html#writing-consistent-snapshots Signed-off-by: Martin Vrachev <[email protected]> * Clarify "paths" and "path_hash_prefixes" Clarify "paths" and "path_hash_prefixes" in delegations, because currently, it's not properly defined which of these options can be used to create a valid target file: - BOTH paths and path_hash_prefixes - ONLY ONE of paths and path_hash_prefixes - NONE of paths and path_hash_prefixes With this change, I aim to define clearly that a valid target file will contain ONLY ONE of them or NONE of them. Signed-off-by: Martin Vrachev <[email protected]> * Update tuf-spec.md Co-authored-by: Trishank Karthik Kuppusamy <[email protected]> Co-authored-by: Joshua Lock <[email protected]> Co-authored-by: Trishank Karthik Kuppusamy <[email protected]> Co-authored-by: Marina Moore <[email protected]>
1 parent 57f636e commit 8dafd00

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tuf-spec.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Boilerplate: copyright no, conformance no
1616
Local Boilerplate: header yes
1717
Markup Shorthands: css no, markdown yes
1818
Metadata Include: This version off, Abstract off
19-
Text Macro: VERSION 1.0.23
19+
Text Macro: VERSION 1.0.24
2020
</pre>
2121

2222
Note: We strive to make the specification easy to implement, so if you come
@@ -692,9 +692,11 @@ The "signed" portion of <a>root.json</a> is as follows:
692692

693693
: <dfn>CONSISTENT_SNAPSHOT</dfn>
694694
::
695-
A boolean indicating whether the repository supports
696-
consistent snapshots. Section [[#consistent-snapshots]] goes into more
697-
detail on the consequences of enabling this setting on a repository.
695+
An OPTIONAL boolean indicating whether the repository supports
696+
consistent snapshots. This field is OPTIONAL for backwards compatibility with
697+
old metadata. New implementations SHOULD include it. Section
698+
[[#consistent-snapshots]] goes into more detail on the consequences of
699+
enabling this setting on a repository.
698700

699701
: <dfn for="role">VERSION</dfn>
700702
::
@@ -980,7 +982,8 @@ as is described for the <a>root.json</a> file.
980982
<a>TARGETPATH</a>. The application may use this information to guide
981983
download decisions.
982984

983-
<dfn>DELEGATIONS</dfn> is an object whose format is the following:
985+
<dfn>DELEGATIONS</dfn> is an OPTIONAL object and if defined it has the following
986+
format:
984987

985988
<pre highlight="json">
986989
{
@@ -1024,9 +1027,8 @@ as is described for the <a>root.json</a> file.
10241027
package that are not made by the delegated party or its descendants to be
10251028
ignored.
10261029

1027-
In order to discuss target paths, a role MUST specify only one of the
1028-
<a>"path_hash_prefixes"</a> or <a for="delegation-role">"paths"</a> attributes,
1029-
each of which we discuss next.
1030+
The <a>"path_hash_prefixes"</a> and <a for="delegation-role">"paths"</a>
1031+
attributes are OPTIONAL, if used, exactly one of them should be set.
10301032

10311033
: <dfn>"path_hash_prefixes"</dfn>
10321034
::

0 commit comments

Comments
 (0)