%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/jeepney/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/jeepney/__pycache__/auth.cpython-312.pyc

�

+�cE���ddlmZddlmZddlZddlmZdefd�Zdefd�Z	dZ
d	ZGd
�de�ZGd�d
e
�ZGd�de�ZGd�d�ZeZy)�)�hexlify)�EnumN)�Optional�returnc�v�tttj��j	d��}d|zS)z�Prepare an AUTH command line with the current effective user ID.

    This is the preferred authentication method for typical D-Bus connections
    over a Unix domain socket.
    �asciisAUTH EXTERNAL %b
)r�str�os�geteuid�encode)�hex_uids �./usr/lib/python3/dist-packages/jeepney/auth.py�make_auth_externalrs/���c�"�*�*�,�'�.�.�w�7�8�G�"�W�,�,�c�R�ddlm}td|zjd��}d|zS)z�Format an AUTH command line for the ANONYMOUS mechanism

    Jeepney's higher-level wrappers don't currently use this mechanism,
    but third-party code may choose to.

    See <https://tools.ietf.org/html/rfc4505> for details.
    �)�__version__z
Jeepney %srsAUTH ANONYMOUS %s
)�rrr)r�traces  r�make_auth_anonymousrs,����\�K�/�7�7��@�A�E�#�e�+�+rsBEGIN
sNEGOTIATE_UNIX_FD
c� �eZdZdZdZdZdZdZy)�ClientStater����N)�__name__�
__module__�__qualname__�WaitingForData�WaitingForOk�WaitingForReject�WaitingForAgreeUnixFD�Success�rrrrs���N��L������Grrc��eZdZdZdd�Zd�Zy)�AuthenticationErrorz%Raised when DBus authentication failsc� �||_||_y�N��msg�data)�selfr,r+s   r�__init__zAuthenticationError.__init__(s�������	rc�8�|j�d|j��S)Nz. Bus sent: r*�r-s r�__str__zAuthenticationError.__str__,s���(�(��<��	�	�}�5�5rN)zAuthentication failed)rrr�__doc__r.r1r%rrr'r'&s��/��6rr'c�"��eZdZdZ�fd�Z�xZS)�FDNegotiationErrorzBRaised when file descriptor support is requested but not availablec�(��t�|�|d��y)Nz%File descriptor support not available)r+)�superr.)r-r,�	__class__s  �rr.zFDNegotiationError.__init__1s���
����#J��Kr)rrrr2r.�
__classcell__)r7s@rr4r4/s���L�L�Lrr4c�R�eZdZdZdd�Zed��Zd�Zdee	fd�Z
d�Zde	fd	�Zy
)�
Authenticatorz�Process data for the SASL authentication conversation

    If enable_fds is True, this includes negotiating support for passing
    file descriptors.
    c��||_t�|_dt�z|_t
j|_d|_y)N�)	�
enable_fds�	bytearray�bufferr�_to_sendrr!�state�error)r-r=s  rr.zAuthenticator.__init__;s6��$����k���� 2� 4�4��
� �-�-��
���
rc�:�|jtjuSr))rArr$r0s r�
authenticatedzAuthenticator.authenticatedBs���z�z�[�0�0�0�0rc�.�t|jd�Sr))�iter�data_to_sendr0s r�__iter__zAuthenticator.__iter__Fs���D�%�%�t�,�,rrc�`�|js|jryd|jc|_}|S)a�Get a line of data to send to the server

        The data returned should be sent before waiting to receive data.
        Returns empty bytes if waiting for more data from the server, and None
        if authentication is finished (success or error).

        Iterating over the Authenticator object will also yield these lines;
        :meth:`feed` should be called with received data inside the loop.
        Nr)rDrBr@)r-�to_sends  rrGzAuthenticator.data_to_sendIs-���������!$�d�m�m���
�w��rc��|jtjurI|jd�r�|jrt
tjfSttjfS|jtjur9|jd�rttjfS||_	t|��||_	t|��)NsOK s
AGREE_UNIX_FD)rArr!�
startswithr=�NEGOTIATE_UNIX_FDr#�BEGINr$rBr4r')r-�lines  r�process_linezAuthenticator.process_lineXs����:�:��1�1�1����v�&��?�?�,�k�.O�.O�O�O� �+�"5�"5�5�5��Z�Z�;�<�<�
<����/�0��k�1�1�1�1��D�J�$�T�*�*���
�!�$�'�'rr,c�p�|xj|z
c_d|jvre|jjdd�\}|_|jrt|jd��|j|�\|_|_yt
|j�dkDrt|jd��y)z�Process received data

        Raises AuthenticationError if the incoming data is not as expected for
        successful authentication. The connection should then be abandoned.
        s
rzUnexpected data receivedi z*Too much data received without line endingN)r?�splitr'rPr@rA�len)r-r,rOs   r�feedzAuthenticator.feedns���	
���t����d�k�k�!� $��� 1� 1�'�1� =��D�$�+��{�{�)�$�+�+�7Q�R�R�(,�(9�(9�$�(?�%�D�M�4�:�����
��
$�%����I��
�%rN)F)
rrrr2r.�propertyrDrHr�bytesrGrPrTr%rrr:r:5sF���
��1��1�-�
�h�u�o�
�(�,��rr:)�binasciir�enumrr
�typingrrVrrrNrMr�
ValueErrorr'r4r:�
SASLParserr%rr�<module>r\sq����	��-�E�-�
,�U�
,�	��,���$��6�*�6�L�,�L�O�O�f�
r

Zerion Mini Shell 1.0