Linux vmi2545633.contaboserver.net 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64
Apache/2.4.62 (Debian)
Server IP : 127.0.0.1 & Your IP : 127.0.0.1
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
certbot /
plugins /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2025-04-08 11:08
__init__.py
23
B
-rw-r--r--
2022-12-07 14:50
common.py
16.92
KB
-rw-r--r--
2022-12-07 14:50
dns_common.py
13.47
KB
-rw-r--r--
2022-12-07 14:50
dns_common_lexicon.py
5.82
KB
-rw-r--r--
2022-12-07 14:50
dns_test_common.py
2.49
KB
-rw-r--r--
2022-12-07 14:50
dns_test_common_lexicon.py
7.3
KB
-rw-r--r--
2022-12-07 14:50
enhancements.py
6.65
KB
-rw-r--r--
2022-12-07 14:50
storage.py
4.19
KB
-rw-r--r--
2022-12-07 14:50
util.py
1.77
KB
-rw-r--r--
2022-12-07 14:50
Save
Rename
"""Base test class for DNS authenticators.""" from typing import Any from typing import Mapping from typing import TYPE_CHECKING import configobj import josepy as jose from unittest import mock from acme import challenges from certbot import achallenges from certbot.compat import filesystem from certbot.plugins.dns_common import DNSAuthenticator from certbot.tests import acme_util from certbot.tests import util as test_util if TYPE_CHECKING: from typing_extensions import Protocol else: Protocol = object DOMAIN = 'example.com' KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) class _AuthenticatorCallableTestCase(Protocol): """Protocol describing a TestCase able to call a real DNSAuthenticator instance.""" auth: DNSAuthenticator def assertTrue(self, *unused_args: Any) -> None: """ See https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue """ def assertEqual(self, *unused_args: Any) -> None: """ See https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertEqual """ class BaseAuthenticatorTest: """ A base test class to reduce duplication between test code for DNS Authenticator Plugins. Assumes: * That subclasses also subclass unittest.TestCase * That the authenticator is stored as self.auth """ achall = achallenges.KeyAuthorizationAnnotatedChallenge( challb=acme_util.DNS01, domain=DOMAIN, account_key=KEY) def test_more_info(self: _AuthenticatorCallableTestCase) -> None: self.assertTrue(isinstance(self.auth.more_info(), str)) # pylint: disable=no-member def test_get_chall_pref(self: _AuthenticatorCallableTestCase) -> None: self.assertEqual(self.auth.get_chall_pref("example.org"), [challenges.DNS01]) # pylint: disable=no-member def test_parser_arguments(self: _AuthenticatorCallableTestCase) -> None: m = mock.MagicMock() self.auth.add_parser_arguments(m) # pylint: disable=no-member m.assert_any_call('propagation-seconds', type=int, default=mock.ANY, help=mock.ANY) def write(values: Mapping[str, Any], path: str) -> None: """Write the specified values to a config file. :param dict values: A map of values to write. :param str path: Where to write the values. """ config = configobj.ConfigObj() for key in values: config[key] = values[key] with open(path, "wb") as f: config.write(outfile=f) filesystem.chmod(path, 0o600)