/usr/lib/python3/dist-packages/certbot/plugins/__pycache__
Edit: /usr/lib/python3/dist-packages/certbot/plugins/__pycache__/common.cpython-310.pyc (15884B)
o
6a > @ sT d Z ddlmZ ddlmZ ddlZddlZddlZddlZddlm Z ddl
Z
ddlmZ ddlm
Z
ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ eeZdd Zdd Z e!dZ"e!dej#Z$G dd deedZG dd deeedZG dd dZ%G dd dZ&dd Z'd!d" Z(dS )#zPlugin common functions. )ABCMeta)abstractmethodN)List)achallenges)crypto_util)errors)reverter) constants)
filesystem)os) Installer)Plugin)
PluginStoragec C s | d S )9ArgumentParser options namespace (prefix of all options).- namer r 8/usr/lib/python3/dist-packages/certbot/plugins/common.pyoption_namespace s r c C s | ddd S );ArgumentParser dest namespace (prefix of all destinations).r _)replacer r r r dest_namespace s r zX(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)z3^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*[a-z]+$c s e Zd ZdZ fddZeedd Zedd Ze dd Z
d
d Ze dd
Zdd Z
dd Zdeej defddZ ZS )r
zGeneric plugin.c s t || || _|| _d S N)super__init__configr )selfr r __class__r r r . s
zPlugin.__init__c C s dS )zAdd plugin arguments to the CLI argument parser.
:param callable add: Function that proxies calls to
`argparse.ArgumentParser.add_argument` prepending options
with unique plugin name prefix.
Nr )clsaddr r r add_parser_arguments3 s zPlugin.add_parser_argumentsc s fdd}| |S )zkInject parser options.
See `~.certbot.interfaces.Plugin.inject_parser_options` for docs.
c s$ j dt | g|R i |S )Nz--{0}{1})add_argumentformatr )arg_name_no_prefixargskwargsr parserr r r" F s z)Plugin.inject_parser_options.
.add)r# )r! r* r r" r r) r inject_parser_options> s
zPlugin.inject_parser_optionsc C
t | jS )r )r r r r r r r L
zPlugin.option_namespacec C s
| j | S )z'Option name (include plugin namespace).)r )r r r r r option_nameQ
zPlugin.option_namec C r, )r )r r r- r r r r U r. zPlugin.dest_namespacec C s | j |dd S )z.Find a destination for given variable ``var``.r r )r r r varr r r destZ s zPlugin.destc C s t | j| |S )z0Find a configuration value for variable ``var``.)getattrr r3 r1 r r r conf` s zPlugin.conffailed_achallsreturnc C s( d tdd |D }dj| j|dS )a9 Human-readable string to help the user troubleshoot the authenticator.
Shown to the user if one or more of the attempted challenges were not a success.
Should describe, in simple language, what the authenticator tried to do, what went
wrong and what the user should try as their "next steps".
TODO: auth_hint belongs in Authenticator but can't be added until the next major
version of Certbot. For now, it lives in .Plugin and auth_handler will only call it
on authenticators that subclass .Plugin. For now, inherit from `.Plugin` to implement
and/or override the method.
:param list failed_achalls: List of one or more failed challenges
(:class:`achallenges.AnnotatedChallenge` subclasses).
:rtype str:
z and c S s h | ]}|j qS r )typ).0achallr r r x s z#Plugin.auth_hint..zThe Certificate Authority couldn't externally verify that the {name} plugin completed the required {challs} challenges. Ensure the plugin is configured correctly and that the changes it makes are accessible from the internet.)r challs)joinsortedr% r )r r6 r<