From b72f451a1b5056be4d22a32f5bb75f744ff21a33 Mon Sep 17 00:00:00 2001 From: James Kasten Date: Fri, 25 Sep 2015 22:26:32 -0700 Subject: [PATCH] rename certs directory to csr directory --- letsencrypt/client.py | 2 +- letsencrypt/configuration.py | 7 +++---- letsencrypt/constants.py | 4 ++-- letsencrypt/interfaces.py | 7 ++----- letsencrypt/tests/client_test.py | 2 +- letsencrypt/tests/configuration_test.py | 4 ++-- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/letsencrypt/client.py b/letsencrypt/client.py index 60eaea5a1..7f035dc25 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -211,7 +211,7 @@ class Client(object): # Create CSR from names key = crypto_util.init_save_key( self.config.rsa_key_size, self.config.key_dir) - csr = crypto_util.init_save_csr(key, domains, self.config.cert_dir) + csr = crypto_util.init_save_csr(key, domains, self.config.csr_dir) return self._obtain_certificate(domains, csr) + (key, csr) diff --git a/letsencrypt/configuration.py b/letsencrypt/configuration.py index 6f3ece9fd..bd1ba162a 100644 --- a/letsencrypt/configuration.py +++ b/letsencrypt/configuration.py @@ -18,8 +18,7 @@ class NamespaceConfig(object): paths defined in :py:mod:`letsencrypt.constants`: - `accounts_dir` - - `cert_dir` - - `cert_key_backup` + - `csr_dir` - `in_progress_dir` - `key_dir` - `renewer_config_file` @@ -54,8 +53,8 @@ class NamespaceConfig(object): return os.path.join(self.namespace.work_dir, constants.BACKUP_DIR) @property - def cert_dir(self): # pylint: disable=missing-docstring - return os.path.join(self.namespace.config_dir, constants.CERT_DIR) + def csr_dir(self): # pylint: disable=missing-docstring + return os.path.join(self.namespace.config_dir, constants.CSR_DIR) @property def cert_key_backup(self): # pylint: disable=missing-docstring diff --git a/letsencrypt/constants.py b/letsencrypt/constants.py index 6c67ce445..0456d3253 100644 --- a/letsencrypt/constants.py +++ b/letsencrypt/constants.py @@ -68,8 +68,8 @@ ACCOUNTS_DIR = "accounts" BACKUP_DIR = "backups" """Directory (relative to `IConfig.work_dir`) where backups are kept.""" -CERT_DIR = "certs" -"""See `.IConfig.cert_dir`.""" +CSR_DIR = "csr" +"""See `.IConfig.csr_dir`.""" CERT_KEY_BACKUP_DIR = "keys-certs" """Directory where all certificates and keys are stored (relative to diff --git a/letsencrypt/interfaces.py b/letsencrypt/interfaces.py index 5db92b368..139e2e9f4 100644 --- a/letsencrypt/interfaces.py +++ b/letsencrypt/interfaces.py @@ -205,12 +205,9 @@ class IConfig(zope.interface.Interface): accounts_dir = zope.interface.Attribute( "Directory where all account information is stored.") backup_dir = zope.interface.Attribute("Configuration backups directory.") - cert_dir = zope.interface.Attribute( + csr_dir = zope.interface.Attribute( "Directory where newly generated Certificate Signing Requests " - "(CSRs) and certificates not enrolled in the renewer are saved.") - cert_key_backup = zope.interface.Attribute( - "Directory where all certificates and keys are stored. " - "Used for easy revocation.") + "(CSRs) are saved.") in_progress_dir = zope.interface.Attribute( "Directory used before a permanent checkpoint is finalized.") key_dir = zope.interface.Attribute("Keys storage.") diff --git a/letsencrypt/tests/client_test.py b/letsencrypt/tests/client_test.py index 93fdf2cd3..fe1cb1243 100644 --- a/letsencrypt/tests/client_test.py +++ b/letsencrypt/tests/client_test.py @@ -113,7 +113,7 @@ class ClientTest(unittest.TestCase): mock_crypto_util.init_save_key.assert_called_once_with( self.config.rsa_key_size, self.config.key_dir) mock_crypto_util.init_save_csr.assert_called_once_with( - mock.sentinel.key, domains, self.config.cert_dir) + mock.sentinel.key, domains, self.config.csr_dir) self._check_obtain_certificate() @mock.patch("letsencrypt.client.zope.component.getUtility") diff --git a/letsencrypt/tests/configuration_test.py b/letsencrypt/tests/configuration_test.py index 498147c6d..79f867be9 100644 --- a/letsencrypt/tests/configuration_test.py +++ b/letsencrypt/tests/configuration_test.py @@ -33,7 +33,7 @@ class NamespaceConfigTest(unittest.TestCase): constants.ACCOUNTS_DIR = 'acc' constants.BACKUP_DIR = 'backups' constants.CERT_KEY_BACKUP_DIR = 'c/' - constants.CERT_DIR = 'certs' + constants.CSR_DIR = 'csr' constants.IN_PROGRESS_DIR = '../p' constants.KEY_DIR = 'keys' constants.TEMP_CHECKPOINT_DIR = 't' @@ -41,7 +41,7 @@ class NamespaceConfigTest(unittest.TestCase): self.assertEqual( self.config.accounts_dir, '/tmp/config/acc/acme-server.org:443/new') self.assertEqual(self.config.backup_dir, '/tmp/foo/backups') - self.assertEqual(self.config.cert_dir, '/tmp/config/certs') + self.assertEqual(self.config.csr_dir, '/tmp/config/csr') self.assertEqual( self.config.cert_key_backup, '/tmp/foo/c/acme-server.org:443/new') self.assertEqual(self.config.in_progress_dir, '/tmp/foo/../p')