-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add client method for initializing from root metadata #210
Conversation
cc @asraa Open question: Should we remove |
The absence of a formal. 1.x.x release does technically absolve us of having to worry about deprecation. However, go-tuf has active users who have been bitten by API changes (i.e. #203). We should be wary about making any breaking API and behaviour changes until we have made a release that can be pinned to and formalised our releases. See #200 and #114 |
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.
One comment more about client.Init
generally: I think, as Hayden suggested from writing this method, that it doesn't always make sense that a client could only init from the latest root keys like client.Init
does.
In fact, I think this new method which effectively just loads trusted root metadata matches the TUF spec better (https://github.com/theupdateframework/specification/blob/master/tuf-spec.md#load-trusted-root-metadata--load-trusted-root).
To the point that @joshuagl made about active users, we are using the existing init ... so removing it would break us ... |
Do we have a release process (which includes making breaking MINOR 0.MINOR.PATCH releases for now) formalized? If so, we should formalize it first before merging this. |
Pull Request Test Coverage Report for Build 1825678182
💛 - Coveralls |
@joshuagl - Do you know when this release process will be formalized? I agree that it'd be nice to document breaking changes in a changelog. One thing to note is this would be a noticeable breaking change, so users who pull in the latest changes would be able to recognize that +1 to @asraa's comment about this following the spec. It calls out that you should be loading a "trusted root metadata file", not just the root keys. It's worth mentioning again that ideally by default, @hosseinsia, as part of the refactor, we can change all of our usages of |
I've updated the PR, changing |
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.
ping on this! @hosseinsia
I would even by happy to keep Init as before and make a new method like InitLocal
, and then deprecate/rename Init
on a release?
@asraa |
@hosseinsia, how should we communicate the differences between This change shouldn't break anyone who's using a pinned version of go-tuf. Once someone updates to the latest commit in go-tuf, their build will break, but it should be clear what the issue is. Either we can include changelog with this commit, or just assume that the documentation on the function is clear. It's also worth noting that impact is low according to https://cs.github.com/?scopeName=All+repos&scope=&q=%22github.com%2Ftheupdateframework%2Fgo-tuf%2Fclient%22+AND+%22.Init%22+AND+-path%3Acosign+AND+-repo%3Atheupdateframework%2Fgo-tuf - I've looked through these and mostly see either usage with Sigstore maintainers or go-tuf maintainers. I'd prefer that we make the change in function signature now. This will make Init align to the TUF specification, since Init does not go through the secure root update flow. |
Potentially, in a release note, we can specify that the |
7c68b42
to
0e429a4
Compare
This will allow users of go-tuf to initialize a client without requiring a remote connection. This is useful for when a root has been updated and the local root verification keys can no longer verify the the latest remote root, except by verifying the chain with client.Update(). Ref theupdateframework#208 Signed-off-by: Hayden Blauzvern <[email protected]>
0e429a4
to
dea5aab
Compare
@hosseinsia I've updated the PR and added a deprecation comment to Init. Please take another look! I'll leave #208 open until a versioned release process is in place, when we can revisit this issue and remove |
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. Thanks!
@hosseinsia staticcheck doesn't like seeing usage of (Also, this still won't break anyone unless they manually update the pinned sha of go-tuf) |
@asraa good resolution. Thanks! |
Signed-off-by: Hayden Blauzvern <[email protected]>
Thanks all for the feedback! Updated the client to switch to InitLocal. |
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
This will allow users of go-tuf to initialize a client
without requiring a remote connection. This is useful
for when a root has been updated and the local root
verification keys can no longer verify the the latest
remote root, except by verifying the chain with
client.Update().
Ref #208
Signed-off-by: Hayden Blauzvern [email protected]