%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/plugins/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/plugins/__pycache__/cred_memory.cpython-312.pyc |
� Ϫ�f� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZm Z ddl mZ dZ eeej � G d� d � � Z e� Zy )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 �* � e Zd ZdZdZeZdZee fZ d� Zy)�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:...)c �� � t � }|rg|j d� }t |� dz rddlm} |d� �t dt |� d� D ]! }|| ||dz }}|j ||� �# |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�passwords �=/usr/lib/python3/dist-packages/twisted/plugins/cred_memory.py�generateCheckerz&InMemoryCheckerFactory.generateChecker- s} � � :�;����_�_�S�)�F��6�{�Q��J�/�0U�V�V��1�c�&�k�1�-� 4��%+�A�Y��q�1�u� �(������(�3� 4� �� N)�__name__� __module__�__qualname__�__doc__�authType�inMemoryCheckerFactoryHelp�authHelp�argStringFormatr r �credentialInterfacesr � r r r r s) � � � �H�)�H�B�O�-�/F�G��r r N)r# �zope.interfacer �twistedr �twisted.cred.checkersr �twisted.cred.credentialsr r r r r% �IPluginr �theInMemoryCheckerFactoryr) r r �<module>r0 sS ��� '� � I� O� 0�� � �_�f�n�n�-�"� "� .�"�J 3�4� r