%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/certbot/_internal/plugins/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/certbot/_internal/plugins/__pycache__/selection.cpython-312.pyc

�

M/�e�=�
��dZddlZddlmZddlmZddlmZddlmZddlmZddlmZdd	lm	Z	dd
l
mZddl
mZddl
m
Z
dd
lmZddlmZddlmZej*e�Z	d,dej0deedej4dedee
j6f
d�Z	d-dej0deedej4dedee
j:f
d�Z	d.dej0deedej4dedee
j>f
d�Z dej0dej4dee
j:fd�Z!e	de
j6��Z"dej0deedej4dedeedee"fd�Z#deejHdedeejHfd�Z%gd�Z&dej0dej4d ee
j>d!ee
j:ddf
d"�Z'dej0dej4d#edeee
j:ee
j>ffd$�Z(d%eed&eedeefd'�Z)dej0deeeeeffd(�Z*d)ed*eedej4ddfd+�Z+y)/z=Decide which plugins to use for authentication & installation�N)�cast)�Iterable)�List)�Optional)�Tuple)�Type)�TypeVar)�
configuration)�errors)�
interfaces)�disco)�os)�util�config�default�plugins�question�returnc�\�t||||tjtjf�S)zPick configurator plugin.)�pick_pluginr�
Authenticator�	Installer�rrrrs    �E/usr/lib/python3/dist-packages/certbot/_internal/plugins/selection.py�pick_configuratorrs.��
����(�	�	!�	!�:�#7�#7�8�:�:�c�>�t||||tjf�S)zPick installer plugin.)rrrrs    r�pick_installerr s ��
�v�w���J�<P�<P�;R�S�Src�>�t||||tjf�S)zPick authentication plugin.)rrrrs    r�pick_authenticatorr (s'������(�Z�-E�-E�,G�I�Irc�v��t|�\}��sy|j�fd��}|j|�t|�dkDrt	j
d�z��|rCt
|j��d}tjd|�|j|�St	j
d�z��)aB
    Get an unprepared interfaces.Installer object.

    :param certbot.configuration.NamespaceConfig config: Configuration
    :param certbot._internal.plugins.disco.PluginsRegistry plugins:
        All plugins registered as entry points.

    :returns: Unprepared installer plugin or None
    :rtype: Plugin or None
    Nc�&��|j��S�N��
check_name)�p_ep�req_insts �r�<lambda>z*get_unprepared_installer.<locals>.<lambda>Bs���T�_�_�X�-F�r�zfFound multiple installers with the name %s, Certbot is unable to determine which one to use. Skipping.rzSelecting plugin: %sz:Could not select or initialize the requested installer %s.)
�cli_plugin_requests�filter�init�lenr�PluginSelectionError�list�values�logger�debug)rr�_�
installers�instr's     @r�get_unprepared_installerr62s����&�f�-�K�A�x������ F�G�J��O�O�F��
�:�����)�)�
4�6>�
?�@�	@���J�%�%�'�(��+�����+�T�2��y�y�� � �
�
%�
%�D�x�O�Q�Qr�P)�bound�ifacesc������|j�fd��}n1|jrtjd��|j	�}|j|�}|j
|�|j�|j�}t|�dkDrZtjd|�tt|j��|�}|�ytt |j
��St|�dk(rOt|j��d}tjd|�|j"ry|j
�Stjd�y)	a�Pick plugin.

    :param certbot.configuration.NamespaceConfig config: Configuration
    :param str default: Plugin name supplied by user or ``None``.
    :param certbot._internal.plugins.disco.PluginsRegistry plugins:
        All plugins registered as entry points.
    :param str question: Question to be presented to the user in case
        multiple candidates are found.
    :param list ifaces: Interfaces that plugins must provide.

    :returns: Initialized plugin.
    :rtype: Plugin

    Nc�&��|j��Sr#r$)r&rs �rr(zpick_plugin.<locals>.<lambda>fs���t���w�/G�raMissing command line flags. For non-interactive execution, you will need to specify a plugin on the command line.  Run with '--help plugins' to see a list of options, and see https://eff.org/letsencrypt-plugins for more detail on what the plugins do and how to use them.r)zMultiple candidate plugins: %srzSingle candidate plugin: %szNo candidate plugin)r+�noninteractive_moder�MissingCommandlineFlag�visibler9r,�prepare�	availabler-r1r2�
choose_pluginr/r0rr7�
misconfigured)	rrrrr9�filtered�prepared�
plugin_ep1�
plugin_ep2s	 `       rrrSs)���"���>�>�"G�H���%�%��/�/�6�7�
7��?�?�$�����v�&�H��M�M�&�������!�!�#�H�
�8�}�q�����5�x�@�"�4����(9�#:�H�E�
�����A�z���(�)�)�	�X��!�	��(�/�/�+�,�Q�/�
����2�J�?��#�#����� � ����*�+�rrDc�R�|D�cgc]}|j|jrdndz��!}}	tj||d��\}}|tjk(rH||}|jr5tj
dj
|j��d��n|Sy�xcc}w)	z�Allow the user to choose their plugin.

    :param list prepared: List of `~.PluginEntryPoint`.
    :param str question: Question to be presented to the user.

    :returns: Plugin entry point chosen by the user.
    :rtype: `~.PluginEntryPoint`

    z [Misconfigured]�T)�force_interactivezxThe selected plugin encountered an error while parsing your server configuration and cannot be used. The error was:

{0}F)�pauseN)�description_with_namerB�display_util�menu�OK�notification�formatr?)rDr�	plugin_ep�opts�code�indexs      rrArA�s���&�'��
�+�+�#,�#:�#:�
��
D�'�D�'��"�'�'��$�$�O���e��<�?�?�"� ���I��&�&��)�)�"�"(�&��):�):�)<�"=�U�L�
!� ����	's�$B$)�webroot�manual�
standalone�dns-cloudflare�dns-digitalocean�dns-dnsimple�dns-dnsmadeeasy�
dns-gehirn�
dns-google�
dns-linode�
dns-luadns�	dns-nsone�dns-ovh�dns-rfc2136�dns-route53�dns-sakuracloud�authr5c��d|_|r$|j|�}|r|j|_d|_|r$|j|�}|r|j|_tjd|j|j�y)zFUpdate the config entries to reflect the plugins we actually selected.Nz0Plugins selected: Authenticator %s, Installer %s)�
authenticator�	find_init�name�	installerr1�info)rrrer5�auth_ep�inst_eps      r�record_chosen_pluginsrn�sx�� �F����#�#�D�)���#*�<�<�F� ��F����#�#�D�)���&�|�|�F��
�K�K�B��$�$�f�&6�&6�8r�verbc�~�t|�\}}d}|dk(rd}|dk(rJdx}}ddlm}|tvr<|s:dj	|t
j|�}	tj|	��d	x}}|d
k(rd}n(|dvr$d}|jrtjd|�d
}
d
}|dk(rU||k(rPt|||�}tttj |�}
tttj"|�}n!|s|rt%||||�}|r
t'|||�}
|r|s
t)d||�|r|
s
t)d||�|d
k(rU|
�S|j*xs|j,}
|d
uxr|
j.dv}|
s|r!tttj"|
�}tj1d|
|�t3|||
|�||
fS)a<
    Figure out which configurator we're going to use, modifies
    config.authenticator and config.installer strings to reflect that choice if
    necessary.

    :raises errors.PluginSelectionError if there was a problem

    :returns: tuple of (`Installer` or None, `Authenticator` or None)
    :rtype: tuple
    rH�enhancezMWhich installer would you like to use to configure the selected enhancements?�runTr��cli_commandz�With the {0} plugin, you probably want to use the "certonly" command, eg:{1}{1}    {2} certonly --{0}{1}{1}(Alternatively, add a --installer flag. See https://eff.org/letsencrypt-plugins{1} and "--help plugins" for more information.)F�certonly)�installrqzRSpecifying an authenticator doesn't make sense when running Certbot with verb "%s"Nrjrg)�nginx�apachez*Selected authenticator %s and installer %s)r*�certbot._internal.clirt�noninstaller_pluginsrPr�lineseprr=rgr1�warningrrrrrrrr �diagnose_configurator_problemrwrxrir2rn)rrro�req_authr'�installer_question�	need_inst�	need_authrt�msgrgrj�configurator�selected_configurator�interactively_selecteds               r�choose_configurator_pluginsr��s���-�V�4��H�h����y��E���u�}� $�$�	�I�5��+�+�H�E�FL�V�����[�F:�
��/�/��4�4� %�%�	�I��z���	�	
�'�	'��	�����N�N�>�?C�
E�9=�M�04�I��u�}��X�-�)���7�C���X�j�&>�&>�?��N�
���*�"6�"6�7��F�	���&�v�x��BT�U�I��.�v�x��I�M���%�k�8�W�E���%�o�x��I�
�z��m�7� &��� =��
�
��"*�T�!1�!_�m�6H�6H�L_�6_�� �$:��X�j�&:�&:�;�]�K�I�
�L�L�=�}�i�X��&�'�=�)�D��m�#�#r�
previously�nowc��|s|S|r>||k7r9d}tj|jt|�t|����|S)z�
    Setting configurators multiple ways is okay, as long as they all agree
    :param str previously: previously identified request for the installer/authenticator
    :param str now: the request currently being processed
    zIToo many flags setting configurators/installers/authenticators {0} -> {1})rr.rP�repr)r�r�r�s   r�set_configuratorr�sH���������]�C��-�-�c�j�j��j�9I�4�PS�9�.U�V�V��Jrc�<�|jx}}t||j�}t||j�}|jrt|d�}t|d�}|j
rt|d�}t|d�}|jrt|d�}|jrt|d�}|jrt|d�}|jrt|d�}|jrt|d�}|jrt|d�}|jrt|d	�}|jrt|d
�}|jrt|d�}|jrt|d�}|j rt|d
�}|j"rt|d�}|j$rt|d�}|j&rt|d�}|j(rt|d�}|j*rt|d�}t,j/d||�||fS)z�
    Figure out which plugins the user requested with CLI and config options

    :returns: (requested authenticator string or None, requested installer string or None)
    :rtype: tuple
    rwrxrWrUrVrXrYrZr[r\r]r^r_r`rarbrcrdz+Requested authenticator %s and installer %s)r�r�rjrgrwrxrWrUrV�dns_cloudflare�dns_digitalocean�dns_dnsimple�dns_dnsmadeeasy�
dns_gehirn�
dns_google�
dns_linode�
dns_luadns�	dns_nsone�dns_ovh�dns_rfc2136�dns_route53�dns_sakuracloudr1r2)rr'r~s   rr*r*$s���!�-�-�-�H�x���&�*:�*:�;�H���&�*>�*>�?�H�
�|�|�#�H�g�6��#�H�g�6��
�}�}�#�H�h�7��#�H�h�7��
���#�H�l�;��
�~�~�#�H�i�8��
�}�}�#�H�h�7��
���#�H�.>�?��
���#�H�.@�A��
���#�H�n�=��
���#�H�.?�@��
���#�H�l�;��
���#�H�l�;��
���#�H�l�;��
���#�H�l�;��
���#�H�k�:��
�~�~�#�H�i�8��
���#�H�m�<��
���#�H�m�<��
���#�H�.?�@��
�L�L�>��(�S��X��r�cfg_type�	requestedc��|r6||vrdj|�}nNdj|||j�}n.|dk(rddlm}dj|�}ndj|�}t	j
|��)a>
    Raise the most helpful error message about a plugin being unavailable

    :param str cfg_type: either "installer" or "authenticator"
    :param str requested: the plugin that was requested
    :param .PluginsRegistry plugins: available plugins

    :raises error.PluginSelectionError: if there was a problem
    z8The requested {0} plugin does not appear to be installedzkThe {0} plugin is not working; there may be problems with your existing configuration.
The error was: {1!r}rjrrsz�Certbot doesn't know how to automatically configure the web server on this system. However, it can still get a certificate for you. Please run "{0} certonly" to do so. You'll need to manually configure your web server to use the resulting certificate.z/{0} could not be determined or is not installed)rP�problemryrtrr.)r�r�rr�rts     rr}r}Zs�����G�#�L�S�S�T]�^�C�H��F�9�g�i�&8�&@�&@�A�
�
�[�	 �5��!�&��-�		�@�F�F�x�P��
�
%�
%�c�
*�*r)z<How would you like to authenticate and install certificates?)z+How would you like to install certificates?)z4How would you like to authenticate with the ACME CA?),�__doc__�logging�typingrrrrrrr	�certbotr
rr�certbot._internal.pluginsr
�certbot.compatr�certbot.displayrrL�	getLogger�__name__r1�NamespaceConfig�str�PluginsRegistry�Pluginrrrrr r6r7r�PluginEntryPointrArzrnr�r�r*r}�rr�<module>r�s8��C���������!���+��0�	��	�	�8�	$��
'6�:�m�;�;�:�h�s�m�:�$�4�4�:� #�:�;C�:�CT�CT�:U�:�$Q�T�=�8�8�T�8�C�=�T�!�1�1�T� �T�!��!5�!5�6�T�(P�I�}�<�<�I�x�PS�}�I� %� 5� 5�I�!$�I�%�Z�%=�%=�>�	I�Q�]�%B�%B�Q�&+�&;�&;�Q�@H��I]�I]�@^�Q�<�C�z�(�(�)��5�
�5�5�5���
�5��.�.�5�:=�5� ���5�+3�A�;�5�p�D��!7�!7�8����$,�U�-C�-C�$D��>I��8�-�"?�"?�8�%�J_�J_�8� (��)A�)A� B�8� (��)=�)=� >�8�CG�8�$O$�
�(E�(E�O$�).�)>�)>�O$�&)�O$�.3�H�Z�=Q�=Q�4R�4<�Z�=U�=U�4V�5W�/X�O$�d
��#��
�X�c�]�
�x�PS�}�
� 3�
� =� =�3�"�8�C�=�(�3�-�#?�@�3�l+�C�+�H�S�M�+�+0�+@�+@�+�EI�+r

Zerion Mini Shell 1.0