403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3.9/site-packages/certbot/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.9/site-packages/certbot/plugins/__pycache__/dns_common_lexicon.cpython-39.pyc
a

�]eE�@sdZddlZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddl
mZzddlmZdd
lmZWney�dZdZYn0e�e�ZGdd�d�Zeeeefeeefeeeeeffd�dd�ZdS)z;Common code for DNS Authenticator Plugins built on Lexicon.�N)�Any)�Dict)�Mapping)�Optional)�Union)�	HTTPError)�RequestException)�errors)�
dns_common)�ConfigResolver)�Providerc@s�eZdZdZdd�dd�Zeeedd�dd�Zeeedd�d	d
�Zedd�dd
�Ze	ee
ejd�dd�Z
eee
ejd�dd�ZdS)�
LexiconClientzI
    Encapsulates all communication with a DNS provider via Lexicon.
    N)�returncCs|dS)N�)�selfrr�F/usr/lib/python3.9/site-packages/certbot/plugins/dns_common_lexicon.py�__init__#szLexiconClient.__init__)�domain�record_name�record_contentrc
Csj|�|�z|jjd||d�WnDtyd}z,tjd|dd�t�d�|���WYd}~n
d}~00dS)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�Zrtype�nameZcontentz'Encountered error adding TXT record: %sT��exc_infozError adding TXT record: {0}N)	�_find_domain_id�providerZ
create_recordr�logger�debugr	�PluginError�format�rrrr�errr�add_txt_record&s	
zLexiconClient.add_txt_recordc
Cs�z|�|�Wn8tjyF}ztjd|dd�WYd}~dSd}~00z|jjd||d�Wn4ty�}ztjd|dd�WYd}~n
d}~00dS)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)rr	rrrrZ
delete_recordrr!rrr�del_txt_record7s	�zLexiconClient.del_txt_record)rrcCs�t�|�}|D]�}z4t|jd�r.||jjd<n||j_|j��WdSty~}z |�||�}|rj|�WYd}~qd}~0t	y�}z |�
||�}|r�|�WYd}~qd}~00qt�d�
||���dS)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
Zbase_domain_name_guesses�hasattrrr%rZauthenticater�_handle_http_error�	Exception�_handle_general_errorr	rr )rrZdomain_name_guesses�domain_namer"Zresult1Zresult2rrrrLs&

�zLexiconClient._find_domain_id)r"r*rcCst�d�||��S)Nz/Error determining zone identifier for {0}: {1}.)r	rr �rr"r*rrrr'ps�z LexiconClient._handle_http_errorcCs$t|��d�s t�d�||��SdS)NzNo domain foundz9Unexpected error determining zone identifier for {0}: {1})�str�
startswithr	rr r+rrrr)ts
�z#LexiconClient._handle_general_error)�__name__�
__module__�__qualname__�__doc__rr,r#r$rrrr	rr'r(r)rrrrr
s$r
)�lexicon_provider_name�lexicon_options�provider_optionsrcCsLd|i}|�|�ts"|�|�n&i}|�|�|||<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
    Z
provider_name)�updaterZ	with_dictZwith_env)r2r3r4ZconfigZprovider_configrrr�build_lexicon_config{s

r6)r1Zlogging�typingrrrrrZrequests.exceptionsrrZcertbotr	Zcertbot.pluginsr
Zlexicon.configrZlexicon.providers.baser�ImportErrorZ	getLoggerr.rr
r,r6rrrr�<module>s,

]�

Youez - 2016 - github.com/yon3zu
LinuXploit