Skip to content

letsencrypt.acme module - #233

Merged
jdkasten merged 40 commits into
certbot:masterfrom
kuba:acme
Feb 16, 2015
Merged

jdkasten merged 40 commits into
certbot:masterfrom
kuba:acme

Conversation

@kuba

@kuba kuba commented Feb 6, 2015

Copy link
Copy Markdown
Contributor

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.acme module.

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.

@kuba

kuba commented Feb 6, 2015

Copy link
Copy Markdown
Contributor Author

Travis is so broken... After #234 gets pulled in, I'll merge with master and it should improve.

@kuba

kuba commented Feb 8, 2015

Copy link
Copy Markdown
Contributor Author

Sorry, for taking so long, @jdkasten. With #234 and misc fixes it should be all well now.

@jdkasten jdkasten mentioned this pull request Feb 8, 2015
kuba added 6 commits February 8, 2015 22:54
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
@kuba

kuba commented Feb 12, 2015

Copy link
Copy Markdown
Contributor Author

Sorry for further commits... While working on acme.challenges I've encountered a couple of bugs that had to be fixed. Hope that doesn't ruin your review process. :)

Comment thread letsencrypt/acme/jose.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdkasten Have you removed your comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) 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.

@jdkasten

Copy link
Copy Markdown
Contributor

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!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kuba

kuba commented Feb 15, 2015

Copy link
Copy Markdown
Contributor Author

All comments (apart from other.py naming: #233 (comment)) are addressed starting 6922124

@kuba

kuba commented Feb 15, 2015

Copy link
Copy Markdown
Contributor Author

@jdkasten

Copy link
Copy Markdown
Contributor

Thanks @kuba for all of this work!

jdkasten added a commit that referenced this pull request Feb 16, 2015
letsencrypt.acme module
@jdkasten
jdkasten merged commit 9d09001 into certbot:master Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants