Codebase list python-certbot-dns-rfc2136 / a608f2f
New upstream version 1.21.0 Harlan Lieberman-Berg 2 years ago
7 changed file(s) with 36 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 2.1
11 Name: certbot-dns-rfc2136
2 Version: 1.18.0
2 Version: 1.21.0
33 Summary: RFC 2136 DNS Authenticator plugin for Certbot
44 Home-page: https://github.com/certbot/certbot
55 Author: Certbot Project
3232 :name: credentials.ini
3333 :caption: Example credentials file:
3434
35 # Target DNS server
35 # Target DNS server (IPv4 or IPv6 address, not a hostname)
3636 dns_rfc2136_server = 192.0.2.1
3737 # Target DNS port
3838 dns_rfc2136_port = 53
1414 from certbot import errors
1515 from certbot.plugins import dns_common
1616 from certbot.plugins.dns_common import CredentialsConfiguration
17 from certbot.util import is_ipaddress
1718
1819 logger = logging.getLogger(__name__)
1920
5354 return 'This plugin configures a DNS TXT record to respond to a dns-01 challenge using ' + \
5455 'RFC 2136 Dynamic Updates.'
5556
56 def _validate_algorithm(self, credentials):
57 def _validate_credentials(self, credentials):
58 server = credentials.conf('server')
59 if not is_ipaddress(server):
60 raise errors.PluginError("The configured target DNS server ({0}) is not a valid IPv4 "
61 "or IPv6 address. A hostname is not allowed.".format(server))
5762 algorithm = credentials.conf('algorithm')
5863 if algorithm:
5964 if not self.ALGORITHMS.get(algorithm.upper()):
6873 'secret': 'TSIG key secret',
6974 'server': 'The target DNS server'
7075 },
71 self._validate_algorithm
76 self._validate_credentials
7277 )
7378
7479 def _perform(self, _domain, validation_name, validation):
00 Metadata-Version: 2.1
11 Name: certbot-dns-rfc2136
2 Version: 1.18.0
2 Version: 1.21.0
33 Summary: RFC 2136 DNS Authenticator plugin for Certbot
44 Home-page: https://github.com/certbot/certbot
55 Author: Certbot Project
0 dnspython
0 dnspython>=1.15.0
11 setuptools>=39.0.1
2 zope.interface
3 acme>=1.18.0
4 certbot>=1.18.0
2 acme>=1.21.0
3 certbot>=1.21.0
54
65 [docs]
76 Sphinx>=1.0
33 from setuptools import find_packages
44 from setuptools import setup
55
6 version = '1.18.0'
6 version = '1.21.0'
77
88 install_requires = [
9 'dnspython',
9 'dnspython>=1.15.0',
1010 'setuptools>=39.0.1',
11 'zope.interface',
1211 ]
1312
1413 if not os.environ.get('SNAP_BUILD'):
7373
7474 self.auth.perform([self.achall])
7575
76 def test_invalid_server_raises(self):
77 config = VALID_CONFIG.copy()
78 config["rfc2136_server"] = "example.com"
79 dns_test_common.write(config, self.config.rfc2136_credentials)
80
81 self.assertRaises(errors.PluginError,
82 self.auth.perform,
83 [self.achall])
84
85 @test_util.patch_display_util()
86 def test_valid_server_passes(self, unused_mock_get_utility):
87 config = VALID_CONFIG.copy()
88 dns_test_common.write(config, self.config.rfc2136_credentials)
89
90 self.auth.perform([self.achall])
91
92 config["rfc2136_server"] = "2001:db8:3333:4444:cccc:dddd:eeee:ffff"
93 dns_test_common.write(config, self.config.rfc2136_credentials)
94
95 self.auth.perform([self.achall])
96
7697
7798 class RFC2136ClientTest(unittest.TestCase):
7899