AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/certbot/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/certbot/plugins/__pycache__/dns_common_lexicon.cpython-310.pyc
o

6��a�
@s�dZddlZddlmZddlmZddlmZddlmZddlmZddl	m
Z
dd	lmZzdd
l
mZddlmZWn
eyKdZdZYnwe�e�ZGdd
�d
�Zdedededeeeffdd�ZdS)z;Common code for DNS Authenticator Plugins built on Lexicon.�N)�Any)�Dict)�Union)�	HTTPError)�RequestException)�errors)�
dns_common)�ConfigResolver)�Providerc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
LexiconClientzI
    Encapsulates all communication with a DNS provider via Lexicon.
    cCs|dS)N�)�selfrr�D/usr/lib/python3/dist-packages/certbot/plugins/dns_common_lexicon.py�__init__!szLexiconClient.__init__c
Cs\|�|�z|jjd||d�WdSty-}ztjd|dd�t�d�|���d}~ww)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�r
�domain�record_name�record_content�errr�add_txt_record$s
	��zLexiconClient.add_txt_recordc
Cs�z|�|�Wntjy#}ztjd|dd�WYd}~dSd}~wwz|jjd||d�WdStyK}ztjd|dd�WYd}~dSd}~ww)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: %sTrNrrz)Encountered error deleting TXT record: %s)rrrrrr�
delete_recordrrrrr�del_txt_record5s	�����zLexiconClient.del_txt_recordcCs�t�|�}|D]S}zt|jd�r||jjd<n||j_|j��WdSty?}z|�||�}|r5|�WYd}~qd}~wt	yZ}z|�
||�}|rP|�WYd}~qd}~wwt�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�hasattrrr&r�authenticater�_handle_http_error�	Exception�_handle_general_errorrrr)r
r�domain_name_guesses�domain_namer"�resultrrrrJs0

������zLexiconClient._find_domain_idcCst�d�||��S)Nz/Error determining zone identifier for {0}: {1}.)rrr�r
r"r.rrrr*ns�z LexiconClient._handle_http_errorcCs$t|��d�st�d�||��SdS)NzNo domain foundz9Unexpected error determining zone identifier for {0}: {1})�str�
startswithrrrr0rrrr,rs
�z#LexiconClient._handle_general_errorN)
�__name__�
__module__�__qualname__�__doc__rr#r%rr*r,rrrrrs$r�lexicon_provider_name�lexicon_options�provider_options�returncCsNd|i}|�|�ts|�|�|Si}|�|�|||<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)r7r8r9�config�provider_configrrr�build_lexicon_configys

�
rA)r6�logging�typingrrr�requests.exceptionsrr�certbotr�certbot.pluginsr�lexicon.configr	�lexicon.providers.baser
�ImportError�	getLoggerr3rrr1rArrrr�<module>s2�
]��
�

Anon7 - 2022
AnonSec Team