TARGETPATH is ambiguously a URL (or not)
See original GitHub issueFrom here: https://github.com/theupdateframework/tuf/blob/develop/docs/tuf-spec.txt#L736-L737
Each key of the TARGETS object is a TARGETPATH. A TARGETPATH is a path to a file that is relative to a mirror’s base URL of targets.
The spec should say that this value is a percent encoded URL that way it is obvious it can be appended unmodified to an existing URL. Otherwise it needs to be "".join([pct_encode(x) for x in target_path.split('/')])
or some other shenanigans.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Ambiguous output from tree with respect to symbolic links
Whenever I use command line tools, I like to make sure that the output can be interpreted unambiguously. On one of my other...
Read more >Drools - Resource does not have neither a source nor a target ...
I'm very new to Drools and adapted the Spring Boot configuration i found here to enable me to read a bunch of rules...
Read more >To Change the Target Address of URL Link or Key-in Link, or Target ...
Open the Links tab in Explorer. The active link set's name appears in the list box and its links appear below its name....
Read more >PipelineResources - Tekton
url : represents the location of the pull request to fetch. provider : represents the SCM provider to use. This will be “guessed”...
Read more >XML-twig approximate matching twig join algorithm based on DTD ...
Therefore, strict matching algorithms are not always perfect. In this paper, we propose XML-twig target path approximate matching twig join algorithm based ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think think the spec should only mention that it’s worth considering target paths and metadata paths be “clean” as different OS’s or FS’s might behave badly with certain input and cite some of those as examples. If someone wants TUF on Linux only, the only path components that should be disallowed are ‘…’ and things prefixed with ‘/’ (the latter really is for overkill safety since implementation should be joining this to a path). So yes, should and should not but not must and must not.
As a note,
TARGETPATH
is neither URL nor a file path. It’s somehow both and needs careful validation so that we don’t break *nix/Windows.For example: https://github.com/heartsucker/rust-tuf/blob/develop/src/metadata.rs#L19-L134
That’s the current validation I do on
TARGETPATH
andMETAPATH
, and I’m pretty sure there’s some checks that are missing.