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/_internal/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/_internal/plugins/__pycache__/disco.cpython-310.pyc
o

6��ap<�@sTdZddlmZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ddlZddlZddl
ZddlZddlmZdd	lmZdd
lmZddlmZddlmZe�e�Zgd
�Z	Gdd�d�ZGdd�de�ZdZdZ dZ!dZ"de	ej#de	de$fdd�Z%de	ej#de	de$fdd�Z&dej#de	ej#de	de$fdd�Z'dS) z.Utilities for plugins discovery and selection.�)�MappingN)�Dict)�Optional)�Type)�Union)�errors)�
interfaces)�	constants)�os)�Error)�certbotzcertbot-apachezcertbot-dns-cloudflarezcertbot-dns-cloudxnszcertbot-dns-digitaloceanzcertbot-dns-dnsimplezcertbot-dns-dnsmadeeasyzcertbot-dns-gehirnzcertbot-dns-googlezcertbot-dns-linodezcertbot-dns-luadnszcertbot-dns-nsonezcertbot-dns-ovhzcertbot-dns-rfc2136zcertbot-dns-route53zcertbot-dns-sakuracloudz
certbot-nginxc@s�eZdZdZdZd+dejfdd�Zdd�Ze	d	d
��Z
edd��Zed
d��Z
edd��Zejdd��Zedd��Zejdd��Zdd�Zedd��Zd,dd�Zdd�Zedd��Zdd �Zed!d"��Zed#d$��Zed%d&��Zd'd(�Zd)d*�ZdS)-�PluginEntryPointzPlugin entry point.NF�entry_pointcCs@|�||�|_|��|_||_d|_d|_d|_d|_d|_	dS)NF)
�entry_point_to_plugin_name�name�load�
plugin_clsr�warning_message�_initialized�	_prepared�_hidden�_long_description)�selfr�with_prefix�r�A/usr/lib/python3/dist-packages/certbot/_internal/plugins/disco.py�__init__4s

zPluginEntryPoint.__init__cCs$||jkr|jrt�|j�dSdS)z(Check if the name refers to this plugin.TF)rr�logger�warning�rrrrr�
check_name>s

zPluginEntryPoint.check_namecCs|r|jjd|jS|jS)z)Unique plugin name for an ``entry_point``�:)�dist�keyr)�clsrrrrrrFsz+PluginEntryPoint.entry_point_to_plugin_namecCs|jjS)zDescription of the plugin.)r�description�rrrrr%MszPluginEntryPoint.descriptioncCsd�|j|j�S)z$Description with name. Handy for UI.z	{0} ({1}))�formatr%rr&rrr�description_with_nameR�z&PluginEntryPoint.description_with_namecCs|jr|jSt|jd|j�S)zLong description of the plugin.�long_description)r�getattrrr%r&rrrr*Wsz!PluginEntryPoint.long_descriptioncC�
||_dS�N)r)rr%rrrr*^�
cCs|jp	t|jdd�S)z%Should this plugin be hidden from UI?�hiddenF)rr+rr&rrrr/bszPluginEntryPoint.hiddencCr,r-)r)r�hiderrrr/gr.cs|p
t�fdd�|D��S)z2Does plugin implements specified interface groups?c3s&�|]}t�fdd�|D��VqdS)c3s�|]	}t�j|�VqdSr-)�_implementsr)�.0�ifacer&rr�	<genexpr>ns��z4PluginEntryPoint.ifaces.<locals>.<genexpr>.<genexpr>N)�all)r2�ifacesr&rrr4ms���
�z*PluginEntryPoint.ifaces.<locals>.<genexpr>)�any�r�
ifaces_groupsrr&rr6ks�zPluginEntryPoint.ifacescCs
|jduS)z(Has the plugin been initialized already?N)rr&rrr�initializedrs
zPluginEntryPoint.initializedcCs&|js|j��|�||j�|_|jS)zMemoized plugin initialization.)r:r�requirerrr�r�configrrr�initws
zPluginEntryPoint.initcCs4|jstd��|D]}t|��|j|�sdSq	dS)z<Verify that the plugin conforms to the specified interfaces.�Plugin is not initialized.FT)r:�
ValueError�_verifyr>r)rr6r3rrr�verify�s�zPluginEntryPoint.verifycCs|js	t�d|�|jduS)z%Has the plugin been prepared already?z$.prepared called on uninitialized %rN)r:r�debugrr&rrr�prepared�s
zPluginEntryPoint.preparedc
Cs�|jdur	td��|jdurzz|j��Wnatjy6}ztjd||dd�||_WYd}~|jSd}~wtjyV}ztjd||dd�||_WYd}~|jSd}~wtj	yv}ztjd||dd�||_WYd}~|jSd}~wwd|_|jS)zMemoized plugin preparation.Nr?zMisconfigured %r: %sT��exc_infozNo installation (%r): %szOther error:(%r): %s)
rr@r�preparer�MisconfigurationErrorrrC�NoInstallationError�PluginError)r�errorrrrrG�s2


�������zPluginEntryPoint.preparecCst|jtj�S)zIs plugin misconfigured?)�
isinstancerrrHr&rrr�
misconfigured�szPluginEntryPoint.misconfiguredcCst|jt�r	|jSdS)zGReturn the Exception raised during plugin setup, or None if all is wellN)rLr�	Exceptionr&rrr�problem�szPluginEntryPoint.problemcCs|jdup|jS)z4Is plugin available, i.e. prepared or misconfigured?T)rrMr&rrr�	available�r)zPluginEntryPoint.availablecCsd�|j�S)NzPluginEntryPoint#{0})r'rr&rrr�__repr__�szPluginEntryPoint.__repr__c	Cs�d�|j�d�|jj�d�d�dd�|j��D���d�|j�g}|jr;|�d�|�	���|j
r;|�d	�|����d
�|�S)Nz* {0}zDescription: {0}zInterfaces: {0}z, css �|]}|jdkr|jVqdS)zcertbot.interfacesN)�
__module__�__name__)r2r$rrrr4�s��
�z+PluginEntryPoint.__str__.<locals>.<genexpr>zEntry point: {0}zInitialized: {0}z	Prep: {0}�
)r'rrr%�join�mrorr:�appendr>rDrG)r�linesrrr�__str__�s
�
�

zPluginEntryPoint.__str__)Fr-)rSrR�__qualname__�__doc__�__hash__�
pkg_resources�
EntryPointrr �classmethodr�propertyr%r(r*�setterr/r6r:r>rBrDrGrMrOrPrQrYrrrrr
.sF









	




r
c@s�eZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)#�PluginsRegistryzPlugins registry.cCstt|����|_dSr-)�dict�sorted�items�_plugins)r�pluginsrrrr�szPluginsRegistry.__init__c
Cs�i}t�d�}|r|�d�ng}tj�|�|D]}tj�|�qt	�
t�tj
�t�tj��}|D]5}|j||dd�}|jdusBJ�|jjtvrf|j||dd�}d|_d�|j|j�}	|	|_d�|	|j�|_q1||�S)	z+Find plugins using setuptools entry points.�CERTBOT_PLUGIN_PATHr!F)rNTzRPlugin legacy name {0} may be removed in a future version. Please use {1} instead.z(WARNING: {0}) {1})r
�getenv�split�sys�path�extendr]�working_set�	add_entry�	itertools�chain�iter_entry_pointsr	�SETUPTOOLS_PLUGINS_ENTRY_POINT�"OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT�_load_entry_pointr"r#�PREFIX_FREE_DISTRIBUTIONSr/r'rrr*)
r$rg�plugin_paths_string�plugin_paths�plugin_path�entry_pointsr�	plugin_ep�prefixed_plugin_ep�messagerrr�find_all�s:
������zPluginsRegistry.find_allcCs�t||�}|j|vr/||j}|jjr|jjjnd}|jjr#|jjjnd}td�|j||���t|jt	j
�r=|||j<|St�d|�|S)N�unknownz+Duplicate plugin name {0} from {1} and {2}.z)%r does not inherit from Plugin, skipping)
r
rrr"r#rNr'�	_providesrr�Pluginrr)r$rrgrr{�other_ep�plugin1�plugin2rrrru�s


�
��z!PluginsRegistry._load_entry_pointcCs
|j|Sr-)rfrrrr�__getitem__�
zPluginsRegistry.__getitem__cC�
t|j�Sr-)�iterrfr&rrr�__iter__r�zPluginsRegistry.__iter__cCr�r-)�lenrfr&rrr�__len__r�zPluginsRegistry.__len__cs�fdd�|j��D�S)z'Initialize all plugins in the registry.csg|]}|����qSr)r>�r2r{�r=rr�
<listcomp>sz(PluginsRegistry.init.<locals>.<listcomp>�rf�valuesr<rr�rr>s
�zPluginsRegistry.initcs t|��fdd�|j��D��S)z"Filter plugins based on predicate.csi|]\}}�|�r||�qSrr)r2rr{��predrr�
<dictcomp>s�z*PluginsRegistry.filter.<locals>.<dictcomp>)�typerfre)rr�rr�r�filters�zPluginsRegistry.filtercC�|�dd��S)z#Filter plugins based on visibility.cSs|jSr-)r/)r{rrr�<lambda>sz)PluginsRegistry.visible.<locals>.<lambda>�r�r&rrr�visible�zPluginsRegistry.visiblec�|��fdd��S)z#Filter plugins based on interfaces.cs
|j��Sr-�r6��p_ep�r9rrr�!�
z(PluginsRegistry.ifaces.<locals>.<lambda>r�r8rr�rr6�zPluginsRegistry.ifacescr�)z%Filter plugins based on verification.cs
|���Sr-)rBr�r�rrr�%r�z(PluginsRegistry.verify.<locals>.<lambda>r�)rr6rr�rrB#r�zPluginsRegistry.verifycCsdd�|j��D�S)z$Prepare all plugins in the registry.cSsg|]}|���qSr)rGr�rrrr�)sz+PluginsRegistry.prepare.<locals>.<listcomp>r�r&rrrrG'szPluginsRegistry.preparecCr�)z%Filter plugins based on availability.cSs|jSr-)rPr�rrrr�-sz+PluginsRegistry.available.<locals>.<lambda>r�r&rrrrP+r�zPluginsRegistry.availablecs8�fdd�|j��D�}t|�dksJ�|r|dSdS)aMFind an initialized plugin.

        This is particularly useful for finding a name for the plugin::

          # plugin is an instance providing Plugin, initialized
          # somewhere else in the code
          plugin_registry.find_init(plugin).name

        Returns ``None`` if ``plugin`` is not found in the registry.

        cs"g|]
}|jr|���ur|�qSr)r:r>r���pluginrrr�=s
�

�z-PluginsRegistry.find_init.<locals>.<listcomp>�rN)rfr�r�)rr��
candidatesrr�r�	find_init0s

zPluginsRegistry.find_initcCs&d�|jjd�dd�|j��D���S)Nz{0}({1})�,cs��|]}t|�VqdSr-)�repr�r2r�rrrr4Fs�
�z+PluginsRegistry.__repr__.<locals>.<genexpr>)r'�	__class__rSrUrfr�r&rrrrQDs
��zPluginsRegistry.__repr__cCs$|jsdSd�dd�|j��D��S)Nz
No pluginsz

csr�r-)�strr�rrrr4Ls�z*PluginsRegistry.__str__.<locals>.<genexpr>)rfrUr�r&rrrrYIszPluginsRegistry.__str__N)rSrRrZr[rr_r~rur�r�r�r>r�r�r6rBrGrPr�rQrYrrrrrb�s(

rbzbZope interface certbot.interfaces.IPlugin is deprecated, use ABC certbot.interface.Plugin instead.zpZope interface certbot.interfaces.IAuthenticator is deprecated, use ABC certbot.interface.Authenticator instead.zhZope interface certbot.interfaces.IInstaller is deprecated, use ABC certbot.interface.Installer instead.ziZope interface certbot.interfaces.IPluginFactory is deprecated, use ABC certbot.interface.Plugin instead.�target_classr3�returncCsBt||�rdS|tjkrtj�|�rt�t�t�	tt
�dSdS�NTF)�
issubclassrr��IPluginFactory�
providedBy�loggingr�_DEPRECATION_FACTORY�warnings�warn�DeprecationWarning�r�r3rrrr�\s

r�cCs�t||�rdS|tjkrtj�|�rt�t�t�	tt
�dS|tjkr7tj�|�r7t�t
�t�	t
t
�dS|tjkrOtj�|�rOt�t�t�	tt
�dSdSr�)r�rr��IPlugin�
implementedByr�r�_DEPRECATION_PLUGINr�r�r��
Authenticator�IAuthenticator�_DEPRECATION_AUTHENTICATOR�	Installer�
IInstaller�_DEPRECATION_INSTALLERr�rrrr1hs



r1�target_instancec
Cs�t||�rdSd}d}|tjkrtj}t}|tjkrtj}t}|tjkr)tj	}t
}|s3td|j����zt
jj�||�t�|�t�|t�WdSt
jjjyv}z|�|�rktjd||j|dd�WYd}~dSWYd}~dSd}~ww)NT�zUnexpected type: z/%s implements %s but object does not verify: %srEF)r�rr�r�r�r�r�r�r�r�r�r@rS�zope�	interfacerB�verifyObjectr�rr�r�r��
exceptions�BrokenImplementationr�rrC)r�r�r3�
zope_ifacer}rKrrrrA~s>






�
���rA)(r[�collections.abcrrpr�rk�typingrrrrr�r]�zope.interfacer��zope.interface.verifyrrr�certbot._internalr	�certbot.compatr
�certbot.errorsr�	getLoggerrSrrvr
rbr�r�r�r�r��boolr�r1rArrrr�<module>sH
 ��

Anon7 - 2022
AnonSec Team