-
Notifications
You must be signed in to change notification settings - Fork 4
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
Broad strokes of how this package might look #1
Conversation
N.B. This refs mozilla-services/telescope#106 although it doesn't close it. I decided to just dump everything into the The name Tests are based around a real Autograph signature, taken from my local dev environment using Autograph 2.7.0. The cert is https://raw.githubusercontent.com/mozilla-services/autograph/master/docs/statics/normandy.content-signature.mozilla.org-20210705.dev.chain. Tests are not unit tests against mocks but functional tests. (Unit tests could be useful too but the functional ones seemed essential.) The cookiecutter template I used automatically set up an entry point for a CLI. I don't do anything with it yet, but it seems like exposing |
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.
CLI utils could be cool yes!
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.
Should a client/wrapper for calling Autograph itself be included in this package, or do you think that's out of scope?
I should also mention that I decided to use |
I think excluding Python < 3.4 is fine at this point. However, it does mean that any consumers must be using asyncio (at least to call into here), which makes it more annoying for synchronous programs to use. This will be annoying for Balrog at the moment, but I'm sure we can work around. I could argue that |
I think including an Autograph client in this package is a great idea! I filed #2 about it. I was also thinking that it would be good to define a pure function for verifying a signature if you already have the x509 chain. I'm a little nervous about this because we do additional validity checks on the certificate chain that don't need to be repeated, so long as the certificate chain is the same. I'd like to defer this question until later. I've filed #3 to discuss this further. |
See pre-commit/mirrors-isort#11, di/pip-api#42. PyCQA/isort#922 doesn't seem to have been released yet, so we explicitly add the `types: [python]` bit.
Thanks @leplatrem for the suggestion.
Thanks @leplatrem for the suggestion.
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.
It looks great!
I cannot tell too much about ABC
, I haven't used them, but it looks like you know what you're doing :)
Thanks @leplatrem for the suggestion.
Thanks @leplatrem for the suggestion.
I'm going to merge this and continue work on the remaining issues in another PR. Thanks everyone who looked at it! |
Here's a code dump of some stuff that does something, although it isn't really complete yet.
The current state of
master
has a bunch of the boring project infrastructure, so you might check that out too. Some stuff is still missing, like CI and 100% code coverage.A lot of this code is based on Normandy's signing.py, but restructured a little bit to use
cryptography
instead ofasn1parse
andfastecdsa
. Unfortunately, we still depend onecdsa
to parse the signature format Autograph gives us. (There may be another way to do this, which I'd love to hear about.)Still missing:
ecdsa
utility to avoid ecdsa dependency/cc @jvehent @mozbhearsum