Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TARGETPATH and PATHPATTERN recommendations #67

Merged
merged 1 commit into from
Dec 3, 2019

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Nov 28, 2019

Closes #63

In addition to recommending the omission of leading directory separators, this commit adds a recommendation for forward slashes as preferred directory separators in TARGETPATH and PATHPATTERN.

The rationale is that a TARGETPATH needs to be concatenated with a mirror's base URL, and as such it might yield unexpected behavior with non standardized paths. Same goes for Unix shell-style pattern matching of target paths using PATHPATTERN.

As suggested by @erickt this commit adds a reference to the "path-relative-URL string" definition from the WHATWG URL spec as the preferred TARGETPATH style.

This commit also switches to using the term "directory separator" instead of the prior used "path separator" to disambiguate from characters that separate paths (e.g. colon on Unix).

@lukpueh
Copy link
Member Author

lukpueh commented Nov 28, 2019

Two questions remain:

  1. Do we want to add a note that says that tuf repository and client software should adapt accordingly if the local system uses other path styles.
    --> IMO it's not necessary (goes without saying)

  2. Do we really need to reference the WHATWG URL spec, and if so, is "path-relative-URL" the right choice, or should it rather be "path-relative-scheme-less-URL".
    --> IMO it's fine as I proposed it in the PR. I think the reference is helpful but we don't need to be more specific than that, i.e. recommend against a scheme prefix (e.g. file://, etc...)

Thoughts, @erickt, @trishankatdatadog, @mnm678, @JustinCappos?

@lukpueh lukpueh changed the title Update TARGETSPATH AND PATHPATTERN recommendations Update TARGETPATH and PATHPATTERN recommendations Nov 28, 2019
In addition to recommending the omission of leading directory
separators, this commit adds a recommendation for forward slashes
as preferred directory separators in TARGETPATH and PATHPATTERN.

The rationale is that a TARGETPATH needs to be concatenated with
a mirror's base URL, and as such it might yield unexpected
behavior with non standardized paths. Same goes for Unix
shell-style pattern matching of target paths using PATHPATTERN.

As suggested by @erickt this commit adds a reference to the
"path-relative-URL string" definition from the WHATWG URL spec as
the preferred TARGETPATH style.

This commit also switches to using the term "directory separator"
instead of the prior used "path separator" to disambiguate from
characters that separate paths (e.g. colon on Unix).
@mnm678
Copy link
Collaborator

mnm678 commented Dec 2, 2019

The fix looks good. As far as the remaining questions:

1: This seems clear from the existing text. We can include more detail about adapting the paths to a local system in a POUF.

2: The reference to the URL spec is helpful, but not necessary. TUF could theoretically work with non-standard urls as long as clients and servers agree. That said, I would leave it in as a helpful reference for implementers.

@erickt
Copy link
Contributor

erickt commented Dec 2, 2019

This also looks good for me, thanks for writing this up. I'd love for this to also be a requirement for maximum interoperability, but I can understand that might be difficult since we might already have some TUF-1.0 users in the field that might be using alternative separators.

@lukpueh
Copy link
Member Author

lukpueh commented Dec 3, 2019

Thanks for the feedback, @mnm678, @erickt and @trishankatdatadog!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is the TUF target path separator always "/"?
4 participants