diff options
-rw-r--r-- | acme_dns_tiny.py | 11 | ||||
-rw-r--r-- | tests/test_acme_dns_tiny.py | 10 |
2 files changed, 3 insertions, 18 deletions
diff --git a/acme_dns_tiny.py b/acme_dns_tiny.py index 4903c63..51252e2 100644 --- a/acme_dns_tiny.py +++ b/acme_dns_tiny.py @@ -9,7 +9,7 @@ please read through it. It's about 326 lines, 225 SLOC with no line exceeding 80cols. Usage: - acme_dns_tiny.py [--contact=MAIL]... [--quiet] [--verbose] + acme_dns_tiny.py [--quiet] [--verbose] [--acme-directory=URL] [--ttl=SECONDS] [--separator=STR] (--account-key=PATH) (--csr=PATH) (--script=PATH) @@ -22,7 +22,6 @@ Options: --quiet suppress output except for errors --verbose show all debug information on stderr --acme-directory=URL where to make acme request, default is Let's Encrypt - --contact=MAIL create/update contact info (ex "mailto:x@example.com") --ttl=SECONDS time before (re)try self check --separator=STR list all chains joined by STR if specified --script=PATH script to run to update the DNS server record @@ -40,7 +39,6 @@ Example: | path/to/ \\ | --account-key=./account.key \\ | --csr=./domain.csr \\ -| --contact=contact@domain \\ | --ttl=300 \\ | --script=./update-dns-record > signed.crt @@ -221,14 +219,13 @@ class ACME: return collections.namedtuple('sreq', ['code', 'headers', 'map', 'text'])(req.status_code, req.headers, jmap, req.text) - def register_account(self, *, contacts=None): + def register_account(self): log.info('Register/Login ACME Account.') srv_terms = self.directory.get('meta', {}).get('termsOfService', '') if srv_terms: log.warning('Terms of service auto agreed: %s', srv_terms) account_request = { **dict({'termsOfServiceAgreed': True} if srv_terms else {}), - **dict({'contact': contacts} if contacts else {}), } sreq = self.sreq(self.directory['newAccount'], account_request) self.jws_header['kid'] = kid = sreq.headers['Location'] @@ -238,9 +235,6 @@ class ACME: elif sreq.code == 200: log.debug(' - Account is already registered: "%s"', kid) sreq = self.sreq(self.jws_header['kid'], {}) - if contacts and (set(contacts) != set(sreq.map['contact'])): - self.sreq(self.jws_header["kid"], account_request) - log.info(' - Account updated with latest contact information.') def new_order(self, *, domains=None): log.info('Request a new ACME order.') @@ -315,7 +309,6 @@ def get_crt(args): domains = extract_domains_from_csr(args['--csr']) acme = ACME(account_key_path=args['--account-key']) acme.init_sreqs(args['--acme-directory'] or ACME_DEFAULT_DIRECTORY) - acme.register_account(contacts=args['--contact']) order, order_location = acme.new_order(domains=domains) log.info('Completing each each authorization challenge') diff --git a/tests/test_acme_dns_tiny.py b/tests/test_acme_dns_tiny.py index 3a29ce4..ffbe0b6 100644 --- a/tests/test_acme_dns_tiny.py +++ b/tests/test_acme_dns_tiny.py @@ -26,7 +26,6 @@ acme_dns_tiny.log_configure = False ACME_STAGING_DIRECTORY = \ 'https://acme-staging-v02.api.letsencrypt.org/directory' DOMAIN = os.getenv('TEST_DOMAIN') -CONTACT = os.getenv('TEST_CONTACT') # form: mailto:name@domain SCRIPT = os.getenv('TEST_SCRIPT') @@ -158,13 +157,8 @@ def subj_fixture(request): CSR_ARGS_COUNTER = 0 @pytest.fixture(scope='module', params=[ - pytest.param(None, id='no_separator/no_contact'), + pytest.param(None, id='no_separator'), pytest.param({'args': {'--separator': '\\0'}}, id='separator'), - pytest.param({'args': {'--contact': [CONTACT]}}, id='contact'), - pytest.param({'args': { - '--contact': [CONTACT], - '--separator': '\\0', - }}, id='separator+contact'), ]) def main_args(tmpdir_factory, account_domain_key, request, subj_fixture): @@ -183,7 +177,6 @@ def main_args(tmpdir_factory, account_domain_key, request, subj_fixture): #'--ttl': 60, # already the default '--ttl': None, '--separator': None, - '--contact': None, '--verbose': None, '--quiet': None, } @@ -219,7 +212,6 @@ def main_args(tmpdir_factory, account_domain_key, request, subj_fixture): def test_sanity_env(): 'check environment is correctly set before running other tests' assert bool(DOMAIN) - assert bool(CONTACT) assert bool(SCRIPT) |