Skip to content

Commit edc8bdc

Browse files
authored
Merge pull request #174 from joshuagl/joshuagl/pathpattern
Clarify PATHPATTERN wildcards are glob-like
2 parents 0ac04c0 + 6fffd36 commit edc8bdc

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

tuf-spec.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Title: The Update Framework Specification
33
Shortname: TUF
44
Status: LS
55
Abstract: A framework for securing software update systems.
6-
Date: 2021-05-27
6+
Date: 2021-07-13
77
Editor: Justin Cappos, NYU
88
Editor: Trishank Karthik Kuppusamy, Datadog
99
Editor: Joshua Lock, VMware
@@ -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.19
19+
Text Macro: VERSION 1.0.20
2020
</pre>
2121

2222
Note: We strive to make the specification easy to implement, so if you come
@@ -1019,8 +1019,8 @@ as is described for the <a>root.json</a> file.
10191019
ignored.
10201020

10211021
In order to discuss target paths, a role MUST specify only one of the
1022-
<a>"path_hash_prefixes"</a> or <a for="delegation-role">"paths"</a> attributes, each of which we
1023-
discuss next.
1022+
<a>"path_hash_prefixes"</a> or <a for="delegation-role">"paths"</a> attributes,
1023+
each of which we discuss next.
10241024

10251025
: <dfn>"path_hash_prefixes"</dfn>
10261026
::
@@ -1036,21 +1036,30 @@ discuss next.
10361036

10371037
: <dfn for="delegation-role">"paths"</dfn>
10381038
::
1039-
A list of strings, where each string describes a path that the role is
1040-
trusted to provide. Clients MUST check that a target is in one of the
1041-
trusted paths of all roles in a delegation chain, not just in a trusted
1042-
path of the role that describes the target file. <dfn>PATHPATTERN</dfn>
1043-
can include shell-style wildcards and supports the Unix filename pattern
1044-
matching convention. Its format may either indicate a path to a single
1045-
file, or to multiple paths with the use of shell-style wildcards. For
1046-
example, the path pattern "targets/*.tgz" would match file paths
1047-
"targets/foo.tgz" and "targets/bar.tgz", but not "targets/foo.txt".
1048-
Likewise, path pattern "foo-version-?.tgz" matches "foo-version-2.tgz" and
1049-
"foo-version-a.tgz", but not "foo-version-alpha.tgz".
1039+
A list of strings, where each string is a <a>PATHPATTERN</a> describing a
1040+
path that the delegated role is trusted to provide. Clients MUST check that
1041+
a target is in one of the trusted paths of all roles in a delegation chain,
1042+
not just in a trusted path of the role that describes the target file.
1043+
1044+
<dfn>PATHPATTERN</dfn> supports the Unix shell pattern matching convention
1045+
for paths ([glob](https://man7.org/linux/man-pages/man7/glob.7.html)bing
1046+
pathnames). Its format may either indicate a path to a single file, or to
1047+
multiple files with the use of shell-style wildcards (`*` or `?`).
10501048
To avoid surprising behavior when matching targets with <a>PATHPATTERN</a>,
1051-
it is RECOMMENDED that <a>PATHPATTERN</a> uses the forward slash (/) as
1052-
directory separator and does not start with a directory separator, akin to
1053-
<a>TARGETPATH</a>.
1049+
it is RECOMMENDED that <a>PATHPATTERN</a> uses the forward slash (`/`) as
1050+
directory separator and does not start with a directory separator, as is
1051+
also recommended for <a>TARGETPATH</a>. A path separator in a path SHOULD
1052+
NOT be matched by a wildcard in the <a>PATHPATTERN</a>.
1053+
1054+
Some example <a>PATHPATTERN</a>s and expected matches:
1055+
* a <a>PATHPATTERN</a> of `"targets/*.tgz"` would match file paths
1056+
`"targets/foo.tgz"` and `"targets/bar.tgz"`, but not `"targets/foo.txt"`.
1057+
* a <a>PATHPATTERN</a> of `"foo-version-?.tgz"` matches
1058+
`"foo-version-2.tgz"` and `"foo-version-a.tgz"`, but not
1059+
`"foo-version-alpha.tgz"`.
1060+
* a <a>PATHPATTERN</a> of `"*.tgz"` would match `"foo.tgz"` and `"bar.tgz"`,
1061+
but not `"targets/foo.tgz"`
1062+
* a <a>PATHPATTERN</a> of `"foo.tgz"` would match only `"foo.tgz"`
10541063

10551064

10561065
Prioritized delegations allow clients to resolve conflicts between delegated

0 commit comments

Comments
 (0)