Skip to content

Configurator and Client Refactor - #135

Merged
jdkasten merged 12 commits into
masterfrom
configurator_tests
Dec 22, 2014
Merged

jdkasten merged 12 commits into
masterfrom
configurator_tests

Conversation

@jdkasten

Copy link
Copy Markdown
Contributor

This pull request is just a large refactor. I am not sure if this is complete, but I thought I would open it up to comment before I have to go to sleep for a couple hours.

I pulled out lower-level code from the Apache Configurator into a separate Apache Parser. Apache Parser is a member of ApacheConfigurator. I would like to write separate classes for each challenge type, but that will come in the next PR.

Client.py has been separated into its particular functions. (obtain certificates, deploy_cert, optimize). I have pulled out all of the setup code (dialogs) into functions that can be accessed by the main script before beginning. The main script now have a naive sense of picking the proper Authenticator and Installer (two new interfaces that represent the previous configurator's functionality).

Separating this into two parts allow things like the Stand-alone configurator to be easily used by itself and also allows the possibility of any other TLS service to write an installer in order to install the cert from something like the stand-alone (null) configurator.

Code works and it is PEP8 compliant. Pylint warnings are pretty low.

I need some rest, but I will review pull requests here in a couple of hours and get everything merged appropriately.

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.

__hash__ and set_port et al below vs "If a class defines mutable objects and implements a cmp() or eq() method, it should not implement hash(), since hashable collection implementations require that a object’s hash value is immutable (if the object’s hash value changes, it will be in the wrong hash bucket)." (https://docs.python.org/2/reference/datamodel.html#object.__hash__)

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.

Yeah... I was worried about that... I didn't get around to the test cases yet in order to verify the problem. Thanks for the info. I will rewrite the class and get testcases in before the merge.

@kuba

kuba commented Dec 17, 2014

Copy link
Copy Markdown
Contributor

Nice :)

  1. Would it be possible to write unittests for the new code, e.g apache.obj.Addr?
  2. client.apache_configurator -> client.apache.configurator? apache.obj -> apache.util ?

@jdkasten

Copy link
Copy Markdown
Contributor Author

About to leave for a few hours... wanted to get this pushed out before I left, there are probably a few things that I missed. I will do further cleanup when I get back.

@jdkasten

Copy link
Copy Markdown
Contributor Author

This branch does temporarily mess up the "revocation experience". I am busy further removing the revocation functions from the client, but this will also require that the send/receive functions should be removed into their own file.

Conflicts:
	letsencrypt/client/client.py
	letsencrypt/client/crypto_util.py
Conflicts:
	letsencrypt/client/apache/configurator.py
	setup.py
@kuba

kuba commented Dec 22, 2014

Copy link
Copy Markdown
Contributor

@jdkasten sure, I forgot what was on the whiteboard :)

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.

2 participants