Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/cred/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/cred/__pycache__/strcred.cpython-310.pyc
o

�b� �@s�dZddlZddlmZmZmZddlmZmZddl	m
Z
ddlmZGdd�de�Z
Gd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�ZdZdd�Zdd�Zdd�ZGdd�d�ZdS)z�
Support for resolving command-line strings that represent different
checkers available to cred.

Examples:
 - passwd:/etc/passwd
 - memory:admin:asdf:user:lkj
 - unix
�N)�Optional�Sequence�Type)�	Attribute�	Interface)�
getPlugins)�usagec@s8eZdZdZed�Zed�Zed�Zed�Zdd�Z	dS)	�ICheckerFactoryz�
    A factory for objects which provide
    L{twisted.cred.checkers.ICredentialsChecker}.

    It's implemented by twistd plugins creating checkers.
    z0A tag that identifies the authentication method.zmA detailed (potentially multi-line) description of precisely what functionality this CheckerFactory provides.z=A short (one-line) description of the argument string format.z@A list of credentials interfaces that this factory will support.cCsdS)z}
        Return an L{twisted.cred.checkers.ICredentialsChecker} provider using the supplied
        argument string.
        N�)�	argstringr
r
�6/usr/lib/python3/dist-packages/twisted/cred/strcred.py�generateChecker2szICheckerFactory.generateCheckerN)
�__name__�
__module__�__qualname__�__doc__r�authType�authHelp�argStringFormat�credentialInterfacesr
r
r
r
rr	s���r	c@�eZdZdZdS)�StrcredExceptionz+
    Base exception class for strcred.
    N�rrrrr
r
r
rr9�rc@r)�InvalidAuthTypezv
    Raised when a user provides an invalid identifier for the
    authentication plugin (known as the authType).
    Nrr
r
r
rr?rrc@r)�InvalidAuthArgumentStringzl
    Raised by an authentication plugin when the argument string
    provided is formatted incorrectly.
    Nrr
r
r
rrFrrc@r)�UnsupportedInterfacesz�
    Raised when an application is given a checker to use that does not
    provide any of the application's supported credentials interfaces.
    Nrr
r
r
rrMrrz<WARNING: This authType is not supported by this application.cCstt�S)z=
    Find all objects that implement L{ICheckerFactory}.
    )rr	r
r
r
r�findCheckerFactoriesYsrcCs&t�D]}|j|kr|Sqt|��)zJ
    Find the first checker factory that supports the given authType.
    )rrr)r�factoryr
r
r�findCheckerFactory`s


�rcCs0d|vr
|�dd�\}}n|}d}t|��|�S)z�
    Returns an L{twisted.cred.checkers.ICredentialsChecker} based on the
    contents of a descriptive string. Similar to
    L{twisted.application.strports}.
    �:��)�splitrr
)�descriptionrrr
r
r�makeCheckerjs
r%c@sheZdZUdZdZeeeee	d<e
jZdd�Z
dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�ZdS)�AuthOptionMixinak
    Defines helper methods that can be added on to any
    L{usage.Options} subclass that needs authentication.

    This mixin implements three new options methods:

    The opt_auth method (--auth) will write two new values to the
    'self' dictionary: C{credInterfaces} (a dict of lists) and
    C{credCheckers} (a list).

    The opt_help_auth method (--help-auth) will search for all
    available checker plugins and list them for the user; it will exit
    when finished.

    The opt_help_auth_type method (--help-auth-type) will display
    detailed help for a particular checker plugin.

    @cvar supportedInterfaces: An iterable object that returns
       credential interfaces which this application is able to support.

    @cvar authOutput: A writeable object to which this options class
        will send all help-related output. Default: L{sys.stdout}
    N�supportedInterfacescCs|jdup	||jvS)zR
        Returns whether a particular credentials interface is supported.
        N)r')�self�	interfacer
r
r�supportsInterface�sz!AuthOptionMixin.supportsInterfacecCs |jD]
}|�|�r
dSqdS)z�
        Returns whether a checker factory will provide at least one of
        the credentials interfaces that we care about.
        TF)rr*�r(rr)r
r
r�supportsCheckerFactory�s


�z&AuthOptionMixin.supportsCheckerFactorycCs�g}|jdur|j}n|jD]}|�|�r|�|�q|s"t|j��d|vr*i|d<d|vr2g|d<|d�|�|D]
}|d�|g��|�q;dS)zM
        Supply a supplied credentials checker to the Options class.
        N�credInterfaces�credCheckers)r'rr*�appendr�
setdefault)r(�checker�	supportedr)r
r
r�
addChecker�s"



�
�zAuthOptionMixin.addCheckerc
Cs�z
|�t|��WdSty }z
t�d|jd��d}~wty5}z
t�d|jd��d}~wtyG}zt�d|��d}~ww)zB
        Specify an authentication method for the server.
        zAuth plugin not supported: %srNzAuth plugin not recognized: %szUnexpected error: %s)r3r%rr�
UsageError�argsr�	Exception)r(r$�er
r
r�opt_auth�s����zAuthOptionMixin.opt_authccs2�t�D]}|jD]}|�|�r|Vnq	qdS)z�
        Return a list of which authTypes will be displayed by --help-auth.
        This makes it a lot easier to test this module.
        N)rrr*r+r
r
r�_checkerFactoriesForOptHelpAuth�s�


���z/AuthOptionMixin._checkerFactoriesForOptHelpAuthcCs�|j�d�|j�d�|j�d�d}|��D]}t|j�|kr&t|j�}qd|}|j�|d�|j�|d�|��D]}|j�||j|jf�q?|j�d�td��)z<
        Show all authentication methods available.
        z#Usage: --auth AuthType[:ArgString]
z-For detailed help: --help-auth-type AuthType
�
rz
  %%-%is	%%s
)�AuthTypezArgString format)z========z================)�
authOutput�writer9�lenrr�
SystemExit)r(�firstLengthr�formatStringr
r
r�
opt_help_auth�s"
��zAuthOptionMixin.opt_help_authcCs�zt|�}Wntyt�d|��w|j�d|�|j�d|j�|j�d�|j���	�D]}|j�d|�
��q3|j�d�|�|�sY|j�dt�|j�d�t
d��)zA
        Show help for a particular authentication type.
        zInvalid auth type: %szUsage: --auth %s[:ArgString]
zArgString format: %s
r:z  %s
r)rrrr4r<r=rr�strip�
splitlines�rstripr,�notSupportedWarningr?)r(r�cf�liner
r
r�opt_help_auth_type�s�
z"AuthOptionMixin.opt_help_auth_type)rrrrr'rrrr�__annotations__�sys�stdoutr<r*r,r3r8r9rBrIr
r
r
rr&xs


r&)rrK�typingrrr�zope.interfacerr�twisted.pluginr�twisted.pythonrr	r6rrrrrFrrr%r&r
r
r
r�<module>s 	


Spamworldpro Mini