Codebase list python-certbot-dns-rfc2136 / 1062b10
New upstream version 1.18.0 Harlan Lieberman-Berg 2 years ago
6 changed file(s) with 36 addition(s) and 40 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 2.1
11 Name: certbot-dns-rfc2136
2 Version: 1.12.0
2 Version: 1.18.0
33 Summary: RFC 2136 DNS Authenticator plugin for Certbot
44 Home-page: https://github.com/certbot/certbot
55 Author: Certbot Project
6 Author-email: client-dev@letsencrypt.org
6 Author-email: certbot-dev@eff.org
77 License: Apache License 2.0
8 Description: UNKNOWN
98 Platform: UNKNOWN
109 Classifier: Development Status :: 5 - Production/Stable
1110 Classifier: Environment :: Plugins
2625 Classifier: Topic :: Utilities
2726 Requires-Python: >=3.6
2827 Provides-Extra: docs
28 License-File: LICENSE.txt
29
30 UNKNOWN
31
00 """DNS Authenticator using RFC 2136 Dynamic Updates."""
11 import logging
2 from typing import Optional
23
34 import dns.flags
45 import dns.message
910 import dns.tsig
1011 import dns.tsigkeyring
1112 import dns.update
12 import zope.interface
1313
1414 from certbot import errors
15 from certbot import interfaces
1615 from certbot.plugins import dns_common
16 from certbot.plugins.dns_common import CredentialsConfiguration
1717
1818 logger = logging.getLogger(__name__)
1919
2020 DEFAULT_NETWORK_TIMEOUT = 45
2121
22 @zope.interface.implementer(interfaces.IAuthenticator)
23 @zope.interface.provider(interfaces.IPluginFactory)
22
2423 class Authenticator(dns_common.DNSAuthenticator):
2524 """DNS Authenticator using RFC 2136 Dynamic Updates
2625
27 This Authenticator uses RFC 2136 Dynamic Updates to fulfull a dns-01 challenge.
26 This Authenticator uses RFC 2136 Dynamic Updates to fulfill a dns-01 challenge.
2827 """
2928
3029 ALGORITHMS = {
4241 ttl = 120
4342
4443 def __init__(self, *args, **kwargs):
45 super(Authenticator, self).__init__(*args, **kwargs)
46 self.credentials = None
44 super().__init__(*args, **kwargs)
45 self.credentials: Optional[CredentialsConfiguration] = None
4746
4847 @classmethod
4948 def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
50 super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=60)
49 super().add_parser_arguments(add, default_propagation_seconds=60)
5150 add('credentials', help='RFC 2136 credentials INI file.')
5251
5352 def more_info(self): # pylint: disable=missing-function-docstring
7978 self._get_rfc2136_client().del_txt_record(validation_name, validation)
8079
8180 def _get_rfc2136_client(self):
81 if not self.credentials: # pragma: no cover
82 raise errors.Error("Plugin has not been prepared.")
8283 return _RFC2136Client(self.credentials.conf('server'),
8384 int(self.credentials.conf('port') or self.PORT),
8485 self.credentials.conf('name'),
8788 dns.tsig.HMAC_MD5))
8889
8990
90 class _RFC2136Client(object):
91 class _RFC2136Client:
9192 """
9293 Encapsulates all communication with the target DNS server.
9394 """
00 Metadata-Version: 2.1
11 Name: certbot-dns-rfc2136
2 Version: 1.12.0
2 Version: 1.18.0
33 Summary: RFC 2136 DNS Authenticator plugin for Certbot
44 Home-page: https://github.com/certbot/certbot
55 Author: Certbot Project
6 Author-email: client-dev@letsencrypt.org
6 Author-email: certbot-dev@eff.org
77 License: Apache License 2.0
8 Description: UNKNOWN
98 Platform: UNKNOWN
109 Classifier: Development Status :: 5 - Production/Stable
1110 Classifier: Environment :: Plugins
2625 Classifier: Topic :: Utilities
2726 Requires-Python: >=3.6
2827 Provides-Extra: docs
28 License-File: LICENSE.txt
29
30 UNKNOWN
31
00 dnspython
11 setuptools>=39.0.1
22 zope.interface
3 acme>=0.29.0
4 certbot>=1.1.0
5
6 [:python_version < "3.3"]
7 mock
3 acme>=1.18.0
4 certbot>=1.18.0
85
96 [docs]
107 Sphinx>=1.0
0 from distutils.version import LooseVersion
10 import os
21 import sys
32
4 from setuptools import __version__ as setuptools_version
53 from setuptools import find_packages
64 from setuptools import setup
75
8 version = '1.12.0'
6 version = '1.18.0'
97
10 # Remember to update local-oldest-requirements.txt when changing the minimum
11 # acme/certbot version.
128 install_requires = [
139 'dnspython',
1410 'setuptools>=39.0.1',
1713
1814 if not os.environ.get('SNAP_BUILD'):
1915 install_requires.extend([
20 'acme>=0.29.0',
21 'certbot>=1.1.0',
16 # We specify the minimum acme and certbot version as the current plugin
17 # version for simplicity. See
18 # https://github.com/certbot/certbot/issues/8761 for more info.
19 f'acme>={version}',
20 f'certbot>={version}',
2221 ])
2322 elif 'bdist_wheel' in sys.argv[1:]:
2423 raise RuntimeError('Unset SNAP_BUILD when building wheels '
2524 'to include certbot dependencies.')
2625 if os.environ.get('SNAP_BUILD'):
2726 install_requires.append('packaging')
28
29 setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
30 if setuptools_known_environment_markers:
31 install_requires.append('mock ; python_version < "3.3"')
32 elif 'bdist_wheel' in sys.argv[1:]:
33 raise RuntimeError('Error, you are trying to build certbot wheels using an old version '
34 'of setuptools. Version 36.2+ of setuptools is required.')
35 elif sys.version_info < (3,3):
36 install_requires.append('mock')
3727
3828 docs_extras = [
3929 'Sphinx>=1.0', # autodoc_member_order = 'bysource', autodoc_default_flags
4636 description="RFC 2136 DNS Authenticator plugin for Certbot",
4737 url='https://github.com/certbot/certbot',
4838 author="Certbot Project",
49 author_email='client-dev@letsencrypt.org',
39 author_email='certbot-dev@eff.org',
5040 license='Apache License 2.0',
5141 python_requires='>=3.6',
5242 classifiers=[
2727 def setUp(self):
2828 from certbot_dns_rfc2136._internal.dns_rfc2136 import Authenticator
2929
30 super(AuthenticatorTest, self).setUp()
30 super().setUp()
3131
3232 path = os.path.join(self.tempdir, 'file.ini')
3333 dns_test_common.write(VALID_CONFIG, path)
4141 # _get_rfc2136_client | pylint: disable=protected-access
4242 self.auth._get_rfc2136_client = mock.MagicMock(return_value=self.mock_client)
4343
44 def test_perform(self):
44 @test_util.patch_display_util()
45 def test_perform(self, unused_mock_get_utility):
4546 self.auth.perform([self.achall])
4647
4748 expected = [mock.call.add_txt_record('_acme-challenge.'+DOMAIN, mock.ANY, mock.ANY)]
6465 self.auth.perform,
6566 [self.achall])
6667
67 def test_valid_algorithm_passes(self):
68 @test_util.patch_display_util()
69 def test_valid_algorithm_passes(self, unused_mock_get_utility):
6870 config = VALID_CONFIG.copy()
6971 config["rfc2136_algorithm"] = "HMAC-sha512"
7072 dns_test_common.write(config, self.config.rfc2136_credentials)