certbot.plugins.dns_common module¶
Common code for DNS Authenticator Plugins.
-
class
certbot.plugins.dns_common.
DNSAuthenticator
(config, name)[source]¶ Bases:
certbot.plugins.common.Plugin
,certbot.interfaces.Authenticator
Base class for DNS Authenticators
-
classmethod
add_parser_arguments
(add, default_propagation_seconds=10)[source]¶ Add plugin arguments to the CLI argument parser.
- Parameters
add (callable) – Function that proxies calls to
argparse.ArgumentParser.add_argument
prepending options with unique plugin name prefix.
-
get_chall_pref
(unused_domain)[source]¶ Return
collections.Iterable
of challenge preferences.- Parameters
domain (str) – Domain for which challenge preferences are sought.
- Returns
collections.Iterable
of challenge types (subclasses ofacme.challenges.Challenge
) with the most preferred challenges first. If a type is not specified, it means the Authenticator cannot perform the challenge.- Return type
collections.Iterable
-
prepare
()[source]¶ Prepare the plugin.
Finish up any additional initialization.
- Raises
PluginError – when full initialization cannot be completed.
MisconfigurationError – when full initialization cannot be completed. Plugin will be displayed on a list of available plugins.
NoInstallationError – when the necessary programs/files cannot be located. Plugin will NOT be displayed on a list of available plugins.
NotSupportedError – when the installation is recognized, but the version is not currently supported.
-
more_info
() → str[source]¶ Human-readable string to help the user.
Should describe the steps taken and any relevant info to help the user decide which plugin to use.
- Rtype str
-
perform
(achalls)[source]¶ Perform the given challenge.
- Parameters
achalls (list) – Non-empty (guaranteed) list of
AnnotatedChallenge
instances, such that it contains types found withinget_chall_pref()
only.- Returns
collections.Iterable
of ACMEChallengeResponse
instances corresponding to each providedChallenge
.- Return type
collections.Iterable
ofacme.challenges.ChallengeResponse
, where responses are required to be returned in the same order as corresponding input challenges- Raises
PluginError – If some or all challenges cannot be performed
-
cleanup
(achalls)[source]¶ Revert changes and shutdown after challenges complete.
This method should be able to revert all changes made by perform, even if perform exited abnormally.
- Parameters
achalls (list) – Non-empty (guaranteed) list of
AnnotatedChallenge
instances, a subset of those previously passed toperform()
.- Raises
PluginError – if original configuration cannot be restored
-
classmethod
-
class
certbot.plugins.dns_common.
CredentialsConfiguration
(filename, mapper=<function CredentialsConfiguration.<lambda>>)[source]¶ Bases:
object
Represents a user-supplied filed which stores API credentials.
-
require
(required_variables)[source]¶ Ensures that the supplied set of variables are all present in the file.
- Parameters
required_variables (dict) – Map of variable which must be present to error to display.
- Raises
errors.PluginError – If one or more are missing.
-
-
certbot.plugins.dns_common.
validate_file_permissions
(filename)[source]¶ Ensure that the specified file exists and warn about unsafe permissions.
-
certbot.plugins.dns_common.
base_domain_name_guesses
(domain)[source]¶ Return a list of progressively less-specific domain names.
One of these will probably be the domain name known to the DNS provider.
- Example
>>> base_domain_name_guesses('foo.bar.baz.example.com') ['foo.bar.baz.example.com', 'bar.baz.example.com', 'baz.example.com', 'example.com', 'com']
- Parameters
domain (str) – The domain for which to return guesses.
- Returns
The a list of less specific domain names.
- Return type
list