�
Ϫ�f� � �� � d Z ddlZddlmZmZmZ ddlmZmZ ddl m
Z
ddlmZ G d� de� Z
G d � d
e� Z G d� de� Z G d
� de� Z G d� de� ZdZd� Zd� Zd� Z G d� d� Zy)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 �V � e Zd ZdZ ed� Z ed� Z ed� Z ed� Zd� Z y)�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.c � � y)z}
Return an L{twisted.cred.checkers.ICredentialsChecker} provider using the supplied
argument string.
N� )� argstrings �6/usr/lib/python3/dist-packages/twisted/cred/strcred.py�generateCheckerzICheckerFactory.generateChecker2 s � � N)
�__name__�
__module__�__qualname__�__doc__r �authType�authHelp�argStringFormat�credentialInterfacesr r
r r r r sG � �� �K�L�H�� ;��H�
�G��O� %�J���r r c � � e Zd ZdZy)�StrcredExceptionz+
Base exception class for strcred.
N�r r r r r
r r r r 9 s � �r r c � � e Zd ZdZy)�InvalidAuthTypezv
Raised when a user provides an invalid identifier for the
authentication plugin (known as the authType).
Nr r
r r r r ? � � �r r c � � e Zd ZdZy)�InvalidAuthArgumentStringzl
Raised by an authentication plugin when the argument string
provided is formatted incorrectly.
Nr r
r r r! r! F r r r! c � � e Zd ZdZy)�UnsupportedInterfacesz�
Raised when an application is given a checker to use that does not
provide any of the application's supported credentials interfaces.
Nr r
r r r# r# M r r r# z<WARNING: This authType is not supported by this application.c � � t t � S )z=
Find all objects that implement L{ICheckerFactory}.
)r r r
r r �findCheckerFactoriesr% Y s � � �o�&�&r c �\ � t � D ] }|j | k( s�|c S t | � �)zJ
Find the first checker factory that supports the given authType.
)r% r r )r �factorys r �findCheckerFactoryr( ` s6 � � (�)� �����x�'��N�� �(�
#�#r c �r � d| v r| j dd� \ }}n| }d}t |� j |� S )z�
Returns an L{twisted.cred.checkers.ICredentialsChecker} based on the
contents of a descriptive string. Similar to
L{twisted.application.strports}.
�:� � )�splitr( r )�descriptionr r s r �makeCheckerr/ j sC � � �k��)�/�/��Q�7���)���� ��h�'�7�7� �B�Br c �t � e Zd ZU dZdZeeee e d< |