HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/twisted/web/_auth/__pycache__/basic.cpython-312.pyc
�

oj^��b�dZddlZddlmZddlmZmZddlmZee�Gd�d��Z	y)z�
HTTP BASIC authentication.

@see: U{http://tools.ietf.org/html/rfc1945}
@see: U{http://tools.ietf.org/html/rfc2616}
@see: U{http://tools.ietf.org/html/rfc2617}
�N)�implementer)�credentials�error)�ICredentialFactoryc�&�eZdZdZdZd�Zd�Zd�Zy)�BasicCredentialFactoryz�
    Credential Factory for HTTP Basic Authentication

    @type authenticationRealm: L{bytes}
    @ivar authenticationRealm: The HTTP authentication realm which will be issued in
        challenges.
    sbasicc��||_y)N��authenticationRealm)�selfrs  �9/usr/lib/python3/dist-packages/twisted/web/_auth/basic.py�__init__zBasicCredentialFactory.__init__"s
��#6�� �c��d|jiS)zy
        Return a challenge including the HTTP authentication realm with which
        this factory was created.
        �realmr
)r�requests  r
�getChallengez#BasicCredentialFactory.getChallenge%s��
��1�1�2�2rc��	tj|dz�}|jdd�}t
|�dk(rtj|�Stjd��#tj$rtjd��wxYw)z�
        Parse the base64-encoded, colon-separated username and password into a
        L{credentials.UsernamePassword} instance.
        s===zInvalid credentials�:��)	�binascii�
a2b_base64�Errorr�LoginFailed�split�lenr�UsernamePassword)r�responser�credss    r
�decodezBasicCredentialFactory.decode,s���
	;��'�'��6�(9�:�E����D�!�$���u�:��?��/�/��7�7��#�#�$9�:�:���~�~�	;��#�#�$9�:�:�	;�s�A!�!)B
N)�__name__�
__module__�__qualname__�__doc__�schemerrr!�rr
rrs����F�7�3�;rr)
r%r�zope.interfacer�twisted.credrr�twisted.web.iwebrrr'rr
�<module>r+s7��
��&�+�/�
�
� �#;�#;�!�#;r