-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add a prefix path to TUF client #159
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #159 +/- ##
==========================================
+ Coverage 68.17% 68.24% +0.06%
==========================================
Files 41 41
Lines 2423 2428 +5
==========================================
+ Hits 1652 1657 +5
Misses 495 495
Partials 276 276
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this approach did not work with tuf-on-ci?
} | ||
} | ||
|
||
var validPathPrefix = regexp.MustCompile("^[a-z0-9_-]*$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var validPathPrefix = regexp.MustCompile("^[a-z0-9_-]*$") | |
var validPathPrefix = regexp.MustCompile("^[a-z0-9_-]+$") |
It should have at least one character, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the default is empty to read from the root.
This is to allow us to store new policy files in the production TUF repository under a
testing
delegation, and for clients to opt-in to using this testing delegation when retrieving policy from TUF.If the prefix path is set, it is prepended to every target path on download with
path.Join
. For example, if the prefix path istesting
and we download the targeta/b
, the TUF client with actually downloadtesting/a/b
.Also get the latest testdata from tuf-dev.