M/e<dZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm Z dd lm Z dd lm Z dd lm Z dd lmZdd lmZddlmZddlmZddlmZ ddlmZe rddlmZGddeZGddeZGddeZ GddeZ!GddeZ"GddeZ#Gd d!eZ$Gd"d#eZ%Gd$d%eZ&Gd&d'e&Z'Gd(d)e&Z(y*#e$reZYwxYw)+zCertbot client interfaces.)ABCMeta)abstractmethod)ArgumentParser)Any)Iterable)List)Optional)Type) TYPE_CHECKING)Union) Challenge)ChallengeResponse)ClientV2) configuration)AnnotatedChallenge) Interface)AccountcdeZdZdZededfdZededdfdZeddde dd fd Z y ) AccountStoragezAccounts storage interface.returnrct)zXFind all accounts. :returns: All found accounts. :rtype: list NotImplementedErrorselfs 4/usr/lib/python3/dist-packages/certbot/interfaces.pyfind_allzAccountStorage.find_alls "## account_idct)zLoad an account by its id. :raises .AccountNotFound: if account could not be found :raises .AccountStorageError: if account could not be loaded :returns: The account loaded :rtype: .Account r)rrs rloadzAccountStorage.load)s "##raccountclientNct)z\Save account. :raises .AccountStorageError: if account could not be saved r)rr"r#s rsavezAccountStorage.save6s "##r) __name__ __module__ __qualname____doc__rrrstrr!rr%rrrrsm%$$y/$$ $s $y $ $$I$x$D$$rr) metaclassceZdZUdZeZeed< eZeed< e de e jdeddffd Z e d dZe defd Zee d ededdfd ZxZS) 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__`). descriptionnameconfigrNc"t|y)zCreate a new `Plugin`. :param configuration.NamespaceConfig config: Configuration. :param str name: Unique plugin name. N)super__init__)rr1r0 __class__s rr4zPlugin.__init__ds rcy)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. Nr+rs rpreparezPlugin.preparenrcy)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: Nr+rs r more_infozPlugin.more_infor8rparsercy)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+)clsr;r0s rinject_parser_optionszPlugin.inject_parser_optionsr8rrN)r&r'r(r)NotImplementedr/r*__annotations__r0rr rNamespaceConfigr4r7r: classmethodrr> __classcell__)r5s@rr.r.@s:&K%"D##x (E(EFcVZ  & 3    >        rr.c|eZdZdZededeeefdZ ede e de e fdZ ede e ddfdZy) AuthenticatorzGeneric Certbot Authenticator. Class represents all possible tools processes that have the ability to perform challenges and attain a certificate. domainrcy)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+)rrGs rget_chall_prefzAuthenticator.get_chall_prefr8rachallscy)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: list of ACME :class:`~acme.challenges.ChallengeResponse` instances corresponding to each provided :class:`~acme.challenges.Challenge`. :rtype: :class:`collections.List` 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 Nr+rrJs rperformzAuthenticator.performr8rNcy)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 Nr+rLs rcleanupzAuthenticator.cleanupr8r)r&r'r(r)rr*rr r rIrrrrMrOr+rrrFrFs  S  Xd9o-F     t$67 DARrs # %- !291!$w!$H[ w[ |8 F8 v| | ~: g: N w @ g 8^]^^m^^W^^^_MsC++C54C5