HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/twisted/plugins/__pycache__/cred_memory.cpython-310.pyc
o

�b��@sldZddlmZddlmZddlmZddlmZm	Z	ddl
mZdZeeej
�Gdd	�d	��Ze�Zd
S)z-
Cred plugin for an in-memory user database.
�)�implementer)�plugin)�'InMemoryUsernamePasswordDatabaseDontUse)�IUsernameHashedPassword�IUsernamePassword)�ICheckerFactoryz�
A checker that uses an in-memory user database.

This is only of use in one-off test programs or examples which
don't want to focus too much on how credentials are verified. You
really don't want to use this for anything else. It is a toy.
c@s,eZdZdZdZeZdZee	fZ
dd�ZdS)�InMemoryCheckerFactorya~
    A factory for in-memory credentials checkers.

    This is only of use in one-off test programs or examples which don't
    want to focus too much on how credentials are verified.

    You really don't want to use this for anything else.  It is, at best, a
    toy.  If you need a simple credentials checker for a real application,
    see L{cred_file.FileCheckerFactory}.
    �memoryz*A colon-separated list (name:password:...)cCspt�}|r6|�d�}t|�drddlm}|d��tdt|�d�D]}||||d}}|�||�q"|S)a
        This checker factory expects to get a list of
        username:password pairs, with each pair also separated by a
        colon. For example, the string 'alice:f:bob:g' would generate
        two users, one named 'alice' and one named 'bob'.
        �:�r)�InvalidAuthArgumentStringz#argstring must be in format U:P:...�)r�split�len�twisted.cred.strcredr�range�addUser)�self�	argstring�checker�piecesr�i�username�password�r�=/usr/lib/python3/dist-packages/twisted/plugins/cred_memory.py�generateChecker-s
z&InMemoryCheckerFactory.generateCheckerN)�__name__�
__module__�__qualname__�__doc__�authType�inMemoryCheckerFactoryHelp�authHelp�argStringFormatrr�credentialInterfacesrrrrrrsrN)r �zope.interfacer�twistedr�twisted.cred.checkersr�twisted.cred.credentialsrrrrr"�IPluginr�theInMemoryCheckerFactoryrrrr�<module>s
	
%