-
Notifications
You must be signed in to change notification settings - Fork 56
Refactor client trust/trust root management #1010
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
Conversation
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
This should be good to go -- the diff is huge because of the checked-in JSON assets, but the core change is pretty minimal:
|
Signed-off-by: William Woodruff <william@trailofbits.com>
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.
Great update! LGTM
On a first pass this looks great (will have another look after more coffee). The various construction methods ( |
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.
Looks good.
There seems to be a clear path to integrating the ClientTrustConfig from tuf once that's available. I believe that will further simplify the construction options of SigningContext and Verifier (as you said the trust/config initialization can then be done once in a single place).
""" | ||
Construct a new `TrustedRoot`. | ||
|
||
@api private |
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've never seen @api private
and can't find any docs (maye because "api" is one of those ruined search words). What does this do?
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.
This is a pdoc
(our document generator) thing -- it marks an otherwise public API (like the ctor) as not receiving public documentation, so that we don't commit to 3p proto types in our public APIs 🙂
(Then again, it's entirely redundant here since _internal.trust
is already undocumented as a completely private API.)
def _from_trust_config(cls, trust_config: ClientTrustConfig) -> SigningContext: | ||
""" | ||
Create a `SigningContext` from the given `ClientTrustConfig`. | ||
|
||
@api private | ||
""" |
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.
This should not be private?
(same comment for verifier.py)
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 think we want to eventually make it public, but doing so right now will result in a visibility mismatch: the ClientTrustConfig
type is in the _internal
namespace, so a public API here will need to know how to instantiate a private type.
(My thinking was that it could be left as private for 3.0, and made public with a refactor in 3.1.)
Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
This rips out a lot of our dedicated state, replacing it with a smaller adapter over the now-standard
ClientTrustConfig
message.TODO:
Closes #324.
Closes #916.