From b0aa0646409eee00056c27ee90ee53c582f64a54 Mon Sep 17 00:00:00 2001 From: alexzorin Date: Tue, 14 Sep 2021 07:48:15 +1000 Subject: [PATCH] dns-rfc2136: use certbot's own is_ipaddress func (#9035) * dns-rfc2136: use certbot's own is_ipaddress func * oldest: pin dnspython==1.15.0 (epel8 version) * inhibit deprecationwarning for dnspython==1.15.0 * dns-rfc2136: declare minimum version of dnspython * add changelog entry --- .../certbot_dns_rfc2136/_internal/dns_rfc2136.py | 4 ++-- certbot-dns-rfc2136/setup.py | 2 +- certbot/CHANGELOG.md | 3 ++- pytest.ini | 5 ++++- tools/oldest_constraints.txt | 2 +- tools/pinning/oldest/pyproject.toml | 1 + 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py b/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py index 9fa68c9d9..98687e6ab 100644 --- a/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py +++ b/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py @@ -3,7 +3,6 @@ import logging from typing import Optional import dns.flags -from dns.inet import is_address import dns.message import dns.name import dns.query @@ -16,6 +15,7 @@ import dns.update from certbot import errors from certbot.plugins import dns_common from certbot.plugins.dns_common import CredentialsConfiguration +from certbot.util import is_ipaddress logger = logging.getLogger(__name__) @@ -57,7 +57,7 @@ class Authenticator(dns_common.DNSAuthenticator): def _validate_credentials(self, credentials): server = credentials.conf('server') - if not is_address(server): + if not is_ipaddress(server): raise errors.PluginError("The configured target DNS server ({0}) is not a valid IPv4 " "or IPv6 address. A hostname is not allowed.".format(server)) algorithm = credentials.conf('algorithm') diff --git a/certbot-dns-rfc2136/setup.py b/certbot-dns-rfc2136/setup.py index 8ae2e2557..151ffad31 100644 --- a/certbot-dns-rfc2136/setup.py +++ b/certbot-dns-rfc2136/setup.py @@ -7,7 +7,7 @@ from setuptools import setup version = '1.20.0.dev0' install_requires = [ - 'dnspython', + 'dnspython>=1.15.0', 'setuptools>=39.0.1', ] diff --git a/certbot/CHANGELOG.md b/certbot/CHANGELOG.md index ff40b3f1a..19cc1a604 100644 --- a/certbot/CHANGELOG.md +++ b/certbot/CHANGELOG.md @@ -15,7 +15,8 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). ### Fixed -* +* The certbot-dns-rfc2136 plugin in Certbot 1.19.0 inadvertently had an implicit + dependency on `dnspython>=2.0`. This has been relaxed to `dnspython>=1.15.0`. More details about these changes can be found on our GitHub repo. diff --git a/pytest.ini b/pytest.ini index a3ec1ce17..5091f2836 100644 --- a/pytest.ini +++ b/pytest.ini @@ -20,9 +20,12 @@ # the certbot.interfaces module. # 4) The deprecation warning raised when importing deprecated attributes from # the certbot.display.util module. +# 5) A deprecation warning is raised in dnspython==1.15.0 in the oldest tests for +# certbot-dns-rfc2136. filterwarnings = error ignore:The external mock module:PendingDeprecationWarning ignore:.*zope. missing __init__:ImportWarning ignore:.*attribute in certbot.interfaces module is deprecated:DeprecationWarning - ignore:.*attribute in certbot.display.util module is deprecated:DeprecationWarning \ No newline at end of file + ignore:.*attribute in certbot.display.util module is deprecated:DeprecationWarning + ignore:decodestring\(\) is a deprecated alias:DeprecationWarning:dns diff --git a/tools/oldest_constraints.txt b/tools/oldest_constraints.txt index 37864e768..9cdf9f81d 100644 --- a/tools/oldest_constraints.txt +++ b/tools/oldest_constraints.txt @@ -22,7 +22,7 @@ cython==0.29.24; (python_version >= "2.6" and python_full_version < "3.0.0") or distlib==0.3.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.5.0" distro==1.0.1 dns-lexicon==3.2.1 -dnspython==2.1.0; python_version >= "3.6" +dnspython==1.15.0 docker-compose==1.24.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" docker-pycreds==0.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" docker==3.7.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" diff --git a/tools/pinning/oldest/pyproject.toml b/tools/pinning/oldest/pyproject.toml index 34db41d5f..70ec89729 100644 --- a/tools/pinning/oldest/pyproject.toml +++ b/tools/pinning/oldest/pyproject.toml @@ -63,6 +63,7 @@ configobj = "5.0.6" cryptography = "2.1.4" distro = "1.0.1" dns-lexicon = "3.2.1" +dnspython = "1.15.0" funcsigs = "0.4" google-api-python-client = "1.5.5" httplib2 = "0.9.2"