-
Notifications
You must be signed in to change notification settings - Fork 275
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
Provide TARGETPATH normalizing convenience interface #1019
Comments
I'm not closing this directly, maybe there is something here... However, current implementation does try to consider target paths as URL fragments, that may or may not map to a local path |
The python-tuf/tuf/api/metadata.py Lines 1545 to 1556 in 8ac7167
To keep the Metadata API minimal, I suggest to implement the requested convenience interface in a future repository tool. Since we don't have a roadmap for that yet, I'll close this issue and add a comment/reference in #1136. |
Description of issue or feature request:
#1008 removes ambiguity in interfaces that take TARGETPATH arguments, by only accepting paths and path patterns that use "/" as directory separator and don't start with "/", as recommended in the specification (see #1018 for even stricter vetting of these arguments).
To provide a friendly user interface we should add normalizing functionality that transforms paths as returned by
os.listdir
,os.walk
,repository_tool.Repository.get_filepaths_in_directory
, etc... into a format that is accepted by methods that take TARGETPATHs.Normalizing includes
os.path.normpath
-like normalization, like collapsing redundant separators and up-level references#957 has some discussions about least-suprise in TARGETPATH, e.g. what do do if an absolute path does not have the targets directory as prefix, or a relative path is passed, etc...
I envision an interface that may be used like this:
or the with the latter two combined
The text was updated successfully, but these errors were encountered: