Skip to content

Commit db66fed

Browse files
Merge pull request #39 from erickt/patch-4
Recommend against leading path separators
2 parents 9f14855 + 454d4b7 commit db66fed

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tuf-spec.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,9 @@ repo](https://github.com/theupdateframework/specification/issues).
788788
}
789789

790790
Each key of the TARGETS object is a TARGETPATH. A TARGETPATH is a path to
791-
a file that is relative to a mirror's base URL of targets.
791+
a file that is relative to a mirror's base URL of targets. It should not
792+
have a leading path separator to avoid surprising behavior when constructing
793+
paths on disk.
792794

793795
It is allowed to have a TARGETS object with no TARGETPATH elements. This
794796
can be used to indicate that no target files are available.
@@ -858,6 +860,8 @@ repo](https://github.com/theupdateframework/specification/issues).
858860
match file paths "targets/foo.tgz" and "targets/bar.tgz", but not
859861
"targets/foo.txt". Likewise, path pattern "foo-version-?.tgz" matches
860862
"foo-version-2.tgz" and "foo-version-a.tgz", but not "foo-version-alpha.tgz".
863+
It should not have a leading path separator to avoid surprising behavior when
864+
constructing paths on disk.
861865

862866
Prioritized delegations allow clients to resolve conflicts between delegated
863867
roles that share responsibility for overlapping target paths. To resolve
@@ -903,21 +907,21 @@ repo](https://github.com/theupdateframework/specification/issues).
903907
],
904908
"name": "project",
905909
"paths": [
906-
"/project/file3.txt"
910+
"project/file3.txt"
907911
],
908912
"threshold": 1
909913
}
910914
]
911915
},
912916
"expires": "2030-01-01T00:00:00Z",
913917
"targets": {
914-
"/file1.txt": {
918+
"file1.txt": {
915919
"hashes": {
916920
"sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da"
917921
},
918922
"length": 31
919923
},
920-
"/file2.txt": {
924+
"dir/file2.txt": {
921925
"hashes": {
922926
"sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99"
923927
},

0 commit comments

Comments
 (0)