o 6a^B@sdZddlmZddlmZddlmZddlZddlmZddl m Z ddl m Z dd l m Z dd l m Z ddlZddlZdd lmZdd lmZdd lmZddlmZGdddedZGdddejjZGdddejjZGdddejjZGdddedZGdddeZGdddeZ GdddeZ!Gd d!d!eZ"Gd"d#d#ejjZ#Gd$d%d%ejjZ$Gd&d'd'edZ%Gd(d)d)edZ&Gd*d+d+edZ'Gd,d-d-Z(e ee(ej)e*ej)e*<dS).zCertbot client interfaces.)ABCMeta)abstractmethod)ArgumentParserN) ModuleType)cast)Iterable)List)Optional) Challenge)ChallengeResponse)AnnotatedChallenge) configurationc@s4eZdZdZeddZeddZeddZdS) AccountStoragezAccounts storage interface.cCt)zXFind all accounts. :returns: All found accounts. :rtype: list NotImplementedErrorselfr4/usr/lib/python3/dist-packages/certbot/interfaces.pyfind_allzAccountStorage.find_allcCr)zLoad an account by its id. :raises .AccountNotFound: if account could not be found :raises .AccountStorageError: if account could not be loaded r)r account_idrrrload"rzAccountStorage.loadcCr)z\Save account. :raises .AccountStorageError: if account could not be saved r)raccountclientrrrsave,szAccountStorage.saveN)__name__ __module__ __qualname____doc__rrrrrrrrrs   r) metaclassc@eZdZdZdS)IConfigz>Deprecated, use certbot.configuration.NamespaceConfig instead.Nrrrr rrrrr#6r#c@r")IPluginFactory9Deprecated, use certbot.interfaces.Plugin as ABC instead.Nr$rrrrr&:r%r&c@r")IPluginr'Nr$rrrrr(>r%r(cs~eZdZUdZeZeed< ede j deffdd Z edd d Z edefd d Z eed ededdfddZZS)Plugina-Certbot plugin. Objects providing this interface will be called without satisfying any entry point "extras" (extra dependencies) you might have defined for your plugin, e.g (excerpt from ``setup.py`` script):: setup( ... entry_points={ 'certbot.plugins': [ 'name=example_project.plugin[plugin_deps]', ], }, extras_require={ 'plugin_deps': ['dep1', 'dep2'], } ) Therefore, make sure such objects are importable and usable without extras. This is necessary, because CLI does the following operations (in order): - loads an entry point, - calls `inject_parser_options`, - requires an entry point, - creates plugin instance (`__call__`). descriptionconfignamecstdS)zCreate a new `Plugin`. :param configuration.NamespaceConfig config: Configuration. :param str name: Unique plugin name. N)super__init__)rr+r, __class__rrr.cszPlugin.__init__returnNcCdS)aPrepare the plugin. Finish up any additional initialization. :raises .PluginError: when full initialization cannot be completed. :raises .MisconfigurationError: when full initialization cannot be completed. Plugin will be displayed on a list of available plugins. :raises .NoInstallationError: when the necessary programs/files cannot be located. Plugin will NOT be displayed on a list of available plugins. :raises .NotSupportedError: when the installation is recognized, but the version is not currently supported. NrrrrrpreparemzPlugin.preparecCr2)zHuman-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: Nrrrrr more_infor4zPlugin.more_infoparsercCr2)aInject argument parser options (flags). 1. Be nice and prepend all options and destinations with `~.common.option_namespace` and `~common.dest_namespace`. 2. Inject options (flags) only. Positional arguments are not allowed, as this would break the CLI. :param ArgumentParser parser: (Almost) top-level CLI parser. :param str name: Unique plugin name. Nr)clsr6r,rrrinject_parser_optionsr4zPlugin.inject_parser_optionsr1N)rrrr NotImplementedr*str__annotations__rr NamespaceConfigr.r3r5 classmethodrr8 __classcell__rrr/rr)Bs    "r)c@r")IAuthenticatorz@Deprecated, use certbot.interfaces.Authenticator as ABC instead.Nr$rrrrr@r%r@c@sbeZdZdZededeefddZede e dee fddZ ede e dd fd d Z d S) AuthenticatorzGeneric Certbot Authenticator. Class represents all possible tools processes that have the ability to perform challenges and attain a certificate. domainr1cCr2)aReturn `collections.Iterable` of challenge preferences. :param str domain: Domain for which challenge preferences are sought. :returns: `collections.Iterable` of challenge types (subclasses of :class:`acme.challenges.Challenge`) with the most preferred challenges first. If a type is not specified, it means the Authenticator cannot perform the challenge. :rtype: `collections.Iterable` Nr)rrBrrrget_chall_prefr4zAuthenticator.get_chall_prefachallscCr2)aPerform the given challenge. :param list achalls: Non-empty (guaranteed) list of :class:`~certbot.achallenges.AnnotatedChallenge` instances, such that it contains types found within :func:`get_chall_pref` only. :returns: `collections.Iterable` of ACME :class:`~acme.challenges.ChallengeResponse` instances corresponding to each provided :class:`~acme.challenges.Challenge`. :rtype: :class:`collections.Iterable` of :class:`acme.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 NrrrDrrrperformr4zAuthenticator.performNcCr2)aRevert changes and shutdown after challenges complete. This method should be able to revert all changes made by perform, even if perform exited abnormally. :param list achalls: Non-empty (guaranteed) list of :class:`~certbot.achallenges.AnnotatedChallenge` instances, a subset of those previously passed to :func:`perform`. :raises PluginError: if original configuration cannot be restored NrrErrrcleanupr4zAuthenticator.cleanup)rrrr rr;rr rCrr r rFrGrrrrrAs rAc@r") IInstallerzs@            ![;~G