Repository navigation
letsencrypt.acme module - #233
Conversation
Conflicts: letsencrypt/client/tests/auth_handler_test.py
|
Travis is so broken... After #234 gets pulled in, I'll merge with |
Conflicts: tox.ini
Conflicts: letsencrypt/client/CONFIG.py letsencrypt/client/auth_handler.py letsencrypt/client/challenge_util.py letsencrypt/client/client.py letsencrypt/client/crypto_util.py letsencrypt/client/revoker.py letsencrypt/client/tests/challenge_util_test.py
Conflicts: letsencrypt/client/le_util.py letsencrypt/client/tests/challenge_util_test.py
|
Sorry for further commits... While working on |
There was a problem hiding this comment.
Intention was to force API clients to use from_json instead (defined in util.JSONDeSerializable), which makes sure input validates against JSON schema before calling _from_valid_json.
However, I've changed it in my local development acme.challenges branch, where it's no longer the case that subobjects of ACME message have schema attribute necessary for validation (it's assumed that validation against JSON schema happens only once, at the Message.from_json "level").
Does this make sense?
There was a problem hiding this comment.
@jdkasten Have you removed your comment?
There was a problem hiding this comment.
:) I was suprised you responded so quickly... but after thinking about it a bit more I understood. I should have edited it with an - I understand comment instead of deleteing... I will replace the original comment above so the history makes sense.
|
Overall, I really like breaking out the challenges into their own separate objects rather than relying on dicts. The restructure to an acme module was absolutely necessary. The code is more complex, but provides a nice abstraction for all of the other classes. Thanks @kuba! |
There was a problem hiding this comment.
Is it possible to put clearer documentation for all of the messages' create functions?
I understand the kwargs and keeping the signature consistent for all messages, but it does make it slightly harder to use.
For instance here is the example new way to create a revocation request from revoker.py
RevocationRequest.create(certificate=certificate, key=key)
Now certificate here is actually passed in as an m2crypto X509 object rather than an acme.util.ComparableX509 as specified in the RevocationRequest documentation.
vs. the old way
// Parameters are well defined in the documentation (exact format... etc)
acme.revocation_request(cert_der, key)
Not being familiar with the code or protocol, it is actually fairly difficult to tell the exact parameters needed. Signatures are generated for you but you must supply the certificate... and it doesn't need to be in the exact format of the instance variable given in the class documentation.
There was a problem hiding this comment.
That was actually a bug. Everything should be wrapped in ComparableX509 and I fixed it in recent commits.
kwargs accepts whatever class constructor does, and this is all documented by :ivar: stanzas. I've added explicit comment about this.
|
All comments (apart from |
|
Fixed the (hidden) merging conflict in 02d5775... GitHub PRs suck: https://developer.atlassian.com/blog/2015/01/a-better-pull-request/ |
|
Thanks @kuba for all of this work! |
In an effort to separate API from the Let's Encrypt CLI, (most of) strictly ACME protocol-related stuff, i.e. all code that could be shared between "client" and "server", has been moved to
letsencrypt.acmemodule.At the same time, new framework for JSON (un)parsing has been used to implement all protocol top-level messages, signatures (with verification!) and JWK. Although it's still an implementation of protocol v00, it should be a lot easier to "restify" the client from such state.
Please test. Comments and feedback greatly appeciated. :) Sorry for an enormous PR!
FYI I'm working on a follow-up PR that implements challenge messages (currently found in
letsencrypt.client.challenge_util) using the framework.