New upstream version 0.35.1
Harlan Lieberman-Berg
4 years ago
0 | 0 | Metadata-Version: 2.1 |
1 | 1 | Name: certbot-dns-rfc2136 |
2 | Version: 0.31.0 | |
2 | Version: 0.35.1 | |
3 | 3 | Summary: RFC 2136 DNS Authenticator plugin for Certbot |
4 | 4 | Home-page: https://github.com/certbot/certbot |
5 | 5 | Author: Certbot Project |
56 | 56 | def _validate_algorithm(self, credentials): |
57 | 57 | algorithm = credentials.conf('algorithm') |
58 | 58 | if algorithm: |
59 | if not self.ALGORITHMS.get(algorithm): | |
59 | if not self.ALGORITHMS.get(algorithm.upper()): | |
60 | 60 | raise errors.PluginError("Unknown algorithm: {0}.".format(algorithm)) |
61 | 61 | |
62 | 62 | def _setup_credentials(self): |
219 | 219 | except Exception as e: |
220 | 220 | raise errors.PluginError('Encountered error when making query: {0}' |
221 | 221 | .format(e)) |
222 |
0 | 0 | """Tests for certbot_dns_rfc2136.dns_rfc2136.""" |
1 | 1 | |
2 | import os | |
3 | 2 | import unittest |
4 | 3 | |
5 | 4 | import dns.flags |
8 | 7 | import mock |
9 | 8 | |
10 | 9 | from certbot import errors |
10 | from certbot.compat import os | |
11 | 11 | from certbot.plugins import dns_test_common |
12 | 12 | from certbot.plugins.dns_test_common import DOMAIN |
13 | 13 | from certbot.tests import util as test_util |
63 | 63 | |
64 | 64 | def test_valid_algorithm_passes(self): |
65 | 65 | config = VALID_CONFIG.copy() |
66 | config["rfc2136_algorithm"] = "HMAC-SHA512" | |
66 | config["rfc2136_algorithm"] = "HMAC-sha512" | |
67 | 67 | dns_test_common.write(config, self.config.rfc2136_credentials) |
68 | 68 | |
69 | 69 | self.auth.perform([self.achall]) |
170 | 170 | result = self.rfc2136_client._query_soa(DOMAIN) |
171 | 171 | |
172 | 172 | query_mock.assert_called_with(mock.ANY, SERVER, port=PORT) |
173 | self.assertTrue(result == True) | |
173 | self.assertTrue(result) | |
174 | 174 | |
175 | 175 | @mock.patch("dns.query.udp") |
176 | 176 | def test_query_soa_not_found(self, query_mock): |
180 | 180 | result = self.rfc2136_client._query_soa(DOMAIN) |
181 | 181 | |
182 | 182 | query_mock.assert_called_with(mock.ANY, SERVER, port=PORT) |
183 | self.assertTrue(result == False) | |
183 | self.assertFalse(result) | |
184 | 184 | |
185 | 185 | @mock.patch("dns.query.udp") |
186 | 186 | def test_query_soa_wraps_errors(self, query_mock): |
0 | 0 | Metadata-Version: 2.1 |
1 | 1 | Name: certbot-dns-rfc2136 |
2 | Version: 0.31.0 | |
2 | Version: 0.35.1 | |
3 | 3 | Summary: RFC 2136 DNS Authenticator plugin for Certbot |
4 | 4 | Home-page: https://github.com/certbot/certbot |
5 | 5 | Author: Certbot Project |
0 | acme>=0.21.1 | |
1 | certbot>=0.21.1 | |
0 | acme>=0.29.0 | |
1 | certbot>=0.34.0 | |
2 | 2 | dnspython |
3 | 3 | mock |
4 | 4 | setuptools |
1 | 1 | from setuptools import find_packages |
2 | 2 | |
3 | 3 | |
4 | version = '0.31.0' | |
4 | version = '0.35.1' | |
5 | 5 | |
6 | 6 | # Remember to update local-oldest-requirements.txt when changing the minimum |
7 | 7 | # acme/certbot version. |
8 | 8 | install_requires = [ |
9 | 'acme>=0.21.1', | |
10 | 'certbot>=0.21.1', | |
9 | 'acme>=0.29.0', | |
10 | 'certbot>=0.34.0', | |
11 | 11 | 'dnspython', |
12 | 12 | 'mock', |
13 | 13 | 'setuptools', |