diff --git a/PKG-INFO b/PKG-INFO index 0627067..fd57a49 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,12 +1,11 @@ Metadata-Version: 2.1 Name: certbot-dns-rfc2136 -Version: 1.12.0 +Version: 1.18.0 Summary: RFC 2136 DNS Authenticator plugin for Certbot Home-page: https://github.com/certbot/certbot Author: Certbot Project -Author-email: client-dev@letsencrypt.org +Author-email: certbot-dev@eff.org License: Apache License 2.0 -Description: UNKNOWN Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Plugins @@ -27,3 +26,7 @@ Classifier: Topic :: Utilities Requires-Python: >=3.6 Provides-Extra: docs +License-File: LICENSE.txt + +UNKNOWN + diff --git a/certbot_dns_rfc2136/_internal/dns_rfc2136.py b/certbot_dns_rfc2136/_internal/dns_rfc2136.py index 57e9506..77007a9 100644 --- a/certbot_dns_rfc2136/_internal/dns_rfc2136.py +++ b/certbot_dns_rfc2136/_internal/dns_rfc2136.py @@ -1,5 +1,6 @@ """DNS Authenticator using RFC 2136 Dynamic Updates.""" import logging +from typing import Optional import dns.flags import dns.message @@ -10,22 +11,20 @@ import dns.tsig import dns.tsigkeyring import dns.update -import zope.interface from certbot import errors -from certbot import interfaces from certbot.plugins import dns_common +from certbot.plugins.dns_common import CredentialsConfiguration logger = logging.getLogger(__name__) DEFAULT_NETWORK_TIMEOUT = 45 -@zope.interface.implementer(interfaces.IAuthenticator) -@zope.interface.provider(interfaces.IPluginFactory) + class Authenticator(dns_common.DNSAuthenticator): """DNS Authenticator using RFC 2136 Dynamic Updates - This Authenticator uses RFC 2136 Dynamic Updates to fulfull a dns-01 challenge. + This Authenticator uses RFC 2136 Dynamic Updates to fulfill a dns-01 challenge. """ ALGORITHMS = { @@ -43,12 +42,12 @@ ttl = 120 def __init__(self, *args, **kwargs): - super(Authenticator, self).__init__(*args, **kwargs) - self.credentials = None + super().__init__(*args, **kwargs) + self.credentials: Optional[CredentialsConfiguration] = None @classmethod def add_parser_arguments(cls, add): # pylint: disable=arguments-differ - super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=60) + super().add_parser_arguments(add, default_propagation_seconds=60) add('credentials', help='RFC 2136 credentials INI file.') def more_info(self): # pylint: disable=missing-function-docstring @@ -80,6 +79,8 @@ self._get_rfc2136_client().del_txt_record(validation_name, validation) def _get_rfc2136_client(self): + if not self.credentials: # pragma: no cover + raise errors.Error("Plugin has not been prepared.") return _RFC2136Client(self.credentials.conf('server'), int(self.credentials.conf('port') or self.PORT), self.credentials.conf('name'), @@ -88,7 +89,7 @@ dns.tsig.HMAC_MD5)) -class _RFC2136Client(object): +class _RFC2136Client: """ Encapsulates all communication with the target DNS server. """ diff --git a/certbot_dns_rfc2136.egg-info/PKG-INFO b/certbot_dns_rfc2136.egg-info/PKG-INFO index 0627067..fd57a49 100644 --- a/certbot_dns_rfc2136.egg-info/PKG-INFO +++ b/certbot_dns_rfc2136.egg-info/PKG-INFO @@ -1,12 +1,11 @@ Metadata-Version: 2.1 Name: certbot-dns-rfc2136 -Version: 1.12.0 +Version: 1.18.0 Summary: RFC 2136 DNS Authenticator plugin for Certbot Home-page: https://github.com/certbot/certbot Author: Certbot Project -Author-email: client-dev@letsencrypt.org +Author-email: certbot-dev@eff.org License: Apache License 2.0 -Description: UNKNOWN Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Plugins @@ -27,3 +26,7 @@ Classifier: Topic :: Utilities Requires-Python: >=3.6 Provides-Extra: docs +License-File: LICENSE.txt + +UNKNOWN + diff --git a/certbot_dns_rfc2136.egg-info/requires.txt b/certbot_dns_rfc2136.egg-info/requires.txt index ee8b833..6bdfd92 100644 --- a/certbot_dns_rfc2136.egg-info/requires.txt +++ b/certbot_dns_rfc2136.egg-info/requires.txt @@ -1,11 +1,8 @@ dnspython setuptools>=39.0.1 zope.interface -acme>=0.29.0 -certbot>=1.1.0 - -[:python_version < "3.3"] -mock +acme>=1.18.0 +certbot>=1.18.0 [docs] Sphinx>=1.0 diff --git a/setup.py b/setup.py index 9351bda..b7f84bc 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,11 @@ -from distutils.version import LooseVersion import os import sys -from setuptools import __version__ as setuptools_version from setuptools import find_packages from setuptools import setup -version = '1.12.0' +version = '1.18.0' -# Remember to update local-oldest-requirements.txt when changing the minimum -# acme/certbot version. install_requires = [ 'dnspython', 'setuptools>=39.0.1', @@ -18,23 +14,17 @@ if not os.environ.get('SNAP_BUILD'): install_requires.extend([ - 'acme>=0.29.0', - 'certbot>=1.1.0', + # We specify the minimum acme and certbot version as the current plugin + # version for simplicity. See + # https://github.com/certbot/certbot/issues/8761 for more info. + f'acme>={version}', + f'certbot>={version}', ]) elif 'bdist_wheel' in sys.argv[1:]: raise RuntimeError('Unset SNAP_BUILD when building wheels ' 'to include certbot dependencies.') if os.environ.get('SNAP_BUILD'): install_requires.append('packaging') - -setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2')) -if setuptools_known_environment_markers: - install_requires.append('mock ; python_version < "3.3"') -elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Error, you are trying to build certbot wheels using an old version ' - 'of setuptools. Version 36.2+ of setuptools is required.') -elif sys.version_info < (3,3): - install_requires.append('mock') docs_extras = [ 'Sphinx>=1.0', # autodoc_member_order = 'bysource', autodoc_default_flags @@ -47,7 +37,7 @@ description="RFC 2136 DNS Authenticator plugin for Certbot", url='https://github.com/certbot/certbot', author="Certbot Project", - author_email='client-dev@letsencrypt.org', + author_email='certbot-dev@eff.org', license='Apache License 2.0', python_requires='>=3.6', classifiers=[ diff --git a/tests/dns_rfc2136_test.py b/tests/dns_rfc2136_test.py index dc4a73a..ec424c6 100644 --- a/tests/dns_rfc2136_test.py +++ b/tests/dns_rfc2136_test.py @@ -28,7 +28,7 @@ def setUp(self): from certbot_dns_rfc2136._internal.dns_rfc2136 import Authenticator - super(AuthenticatorTest, self).setUp() + super().setUp() path = os.path.join(self.tempdir, 'file.ini') dns_test_common.write(VALID_CONFIG, path) @@ -42,7 +42,8 @@ # _get_rfc2136_client | pylint: disable=protected-access self.auth._get_rfc2136_client = mock.MagicMock(return_value=self.mock_client) - def test_perform(self): + @test_util.patch_display_util() + def test_perform(self, unused_mock_get_utility): self.auth.perform([self.achall]) expected = [mock.call.add_txt_record('_acme-challenge.'+DOMAIN, mock.ANY, mock.ANY)] @@ -65,7 +66,8 @@ self.auth.perform, [self.achall]) - def test_valid_algorithm_passes(self): + @test_util.patch_display_util() + def test_valid_algorithm_passes(self, unused_mock_get_utility): config = VALID_CONFIG.copy() config["rfc2136_algorithm"] = "HMAC-sha512" dns_test_common.write(config, self.config.rfc2136_credentials)