diff --git a/PKG-INFO b/PKG-INFO index 4d5a45c..fd57a49 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,12 +1,11 @@ Metadata-Version: 2.1 Name: certbot-dns-rfc2136 -Version: 1.10.1 +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 @@ -14,8 +13,6 @@ Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 @@ -27,5 +24,9 @@ Classifier: Topic :: System :: Networking Classifier: Topic :: System :: Systems Administration Classifier: Topic :: Utilities -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* +Requires-Python: >=3.6 Provides-Extra: docs +License-File: LICENSE.txt + +UNKNOWN + diff --git a/certbot_dns_rfc2136/__init__.py b/certbot_dns_rfc2136/__init__.py index da8ef34..3c57483 100644 --- a/certbot_dns_rfc2136/__init__.py +++ b/certbot_dns_rfc2136/__init__.py @@ -3,6 +3,10 @@ completing a ``dns-01`` challenge (`~acme.challenges.DNS01`) by creating, and subsequently removing, TXT records using RFC 2136 Dynamic Updates. +.. note:: + The plugin is not installed by default. It can be installed by heading to + `certbot.eff.org `_, choosing your system and + selecting the Wildcard tab. Named Arguments --------------- diff --git a/certbot_dns_rfc2136/_internal/dns_rfc2136.py b/certbot_dns_rfc2136/_internal/dns_rfc2136.py index a3a9436..77007a9 100644 --- a/certbot_dns_rfc2136/_internal/dns_rfc2136.py +++ b/certbot_dns_rfc2136/_internal/dns_rfc2136.py @@ -1,15 +1,6 @@ -# type: ignore -# pylint: disable=no-member -# Many attributes of dnspython are now dynamically defined which causes both -# mypy and pylint to error about accessing attributes they think do not exist. -# This is the case even in up-to-date versions of mypy and pylint which as of -# writing this are 0.790 and 2.6.0 respectively. This problem may be fixed in -# dnspython 2.1.0. See https://github.com/rthalley/dnspython/issues/598. For -# now, let's disable these checks. This is done at the very top of the file -# like this because "type: ignore" must be the first line in the file to be -# respected by mypy. """DNS Authenticator using RFC 2136 Dynamic Updates.""" import logging +from typing import Optional import dns.flags import dns.message @@ -20,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 = { @@ -53,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 @@ -90,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'), @@ -98,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 4d5a45c..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.10.1 +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 @@ -14,8 +13,6 @@ Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 @@ -27,5 +24,9 @@ Classifier: Topic :: System :: Networking Classifier: Topic :: System :: Systems Administration Classifier: Topic :: Utilities -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* +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 cddf2e9..6bdfd92 100644 --- a/certbot_dns_rfc2136.egg-info/requires.txt +++ b/certbot_dns_rfc2136.egg-info/requires.txt @@ -1,11 +1,8 @@ dnspython -setuptools +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/docs/conf.py b/docs/conf.py index bc0e9c8..782f494 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -111,7 +111,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # -- Options for HTMLHelp output ------------------------------------------ diff --git a/setup.py b/setup.py index d3b3741..b7f84bc 100644 --- a/setup.py +++ b/setup.py @@ -1,40 +1,30 @@ -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.10.1' +version = '1.18.0' -# Remember to update local-oldest-requirements.txt when changing the minimum -# acme/certbot version. install_requires = [ 'dnspython', - 'setuptools', + 'setuptools>=39.0.1', 'zope.interface', ] 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,9 +37,9 @@ 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='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*', + python_requires='>=3.6', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Plugins', @@ -57,8 +47,6 @@ 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 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)