HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //proc/self/root/usr/local/lib/python3.9/site-packages/amqp/__pycache__/sasl.cpython-39.pyc
a

X>hb�@s�dZddlZddlZddlmZddlmZGdd�d�ZGdd�de�ZGd	d
�d
e�Z	dd�Z
e
�ZGd
d�de�ZGdd�de�Z
dS)z(SASL mechanisms for AMQP authentication.�N)�BytesIO)�_write_tablec@s$eZdZdZedd��Zdd�ZdS)�SASLz�The base class for all amqp SASL authentication mechanisms.

    You should sub-class this if you're implementing your own authentication.
    cCst�dS)z2Return a bytes containing the SASL mechanism name.N��NotImplementedError��self�r	�3/usr/local/lib/python3.9/site-packages/amqp/sasl.py�	mechanismszSASL.mechanismcCst�dS)z@Return the first response to a SASL challenge as a bytes object.Nr�r�
connectionr	r	r
�startsz
SASL.startN)�__name__�
__module__�__qualname__�__doc__�propertyrrr	r	r	r
r
s
rc@s(eZdZdZdZdd�ZdZdd�ZdS)	�PLAINzbPLAIN SASL authentication mechanism.

    See https://tools.ietf.org/html/rfc4616 for details
    sPLAINcCs|||_|_dS�N��username�password�rrrr	r	r
�__init__"szPLAIN.__init__rcCs^|jdus|jdurtSt�}|�d�|�|j�d��|�d�|�|j�d��|��S)N�zutf-8)rr�NotImplementedr�write�encode�getvalue�rr
Zlogin_responser	r	r
r*s

zPLAIN.startN�rrrrrr�	__slots__rr	r	r	r
rs
rc@s(eZdZdZdZdd�ZdZdd�ZdS)	�AMQPLAINzhAMQPLAIN SASL authentication mechanism.

    This is a non-standard mechanism used by AMQP servers.
    sAMQPLAINcCs|||_|_dSrrrr	r	r
r=szAMQPLAIN.__init__rcCsF|jdus|jdurtSt�}t|j|jd�|jg�|��dd�S)N)sLOGINsPASSWORD�)rrrrrrrr r	r	r
rEs�zAMQPLAIN.startNr!r	r	r	r
r#5s
r#csXzddl�ddl�Wn&ty:Gdd�dt�}|YS0G�fdd�dt�}|SdS)Nrc@s&eZdZdZdZd	dd�Zdd�ZdS)
z)_get_gssapi_mechanism.<locals>.FakeGSSAPIz7A no-op SASL mechanism for when gssapi isn't available.N�amqpFcSs|std��dS)Nz?You need to install the `gssapi` module for GSSAPI SASL supportr�r�client_name�service�rdns�	fail_softr	r	r
rYs�z2_get_gssapi_mechanism.<locals>.FakeGSSAPI.__init__cSstSr)rrr	r	r
r`sz/_get_gssapi_mechanism.<locals>.FakeGSSAPI.start)Nr%FF�rrrrrrrr	r	r	r
�
FakeGSSAPITs�
r,cs6eZdZdZdZd
dd�ZdZd	d
�Z�fdd�ZdS)z%_get_gssapi_mechanism.<locals>.GSSAPIzsGSSAPI SASL authentication mechanism.

            See https://tools.ietf.org/html/rfc4752 for details
            sGSSAPINr%FcSs4|rt|t�s|�d�}||_||_||_||_dS)N�ascii)�
isinstance�bytesrr'r*r(r)r&r	r	r
rls
z._get_gssapi_mechanism.<locals>.GSSAPI.__init__)r'r*r(r)cSs^|jj}|jr>|jtjtjfvr>|��}t�|d�\}}}n|jj	}t
|t�sZ|�d�}|S)Nrr-)
�	transport�sockr)�family�socket�AF_INET�AF_INET6�getpeername�
gethostbyaddr�hostr.r/r)rr
r1�peer�hostname�_r	r	r
�get_hostname|s�

z2_get_gssapi_mechanism.<locals>.GSSAPI.get_hostnamecs�z`|jr�j��|j�d�}nd}|�|�}��d�|j|g��jj�}�j||d�}|�	d�WS�j
jjy�|j
r�tYS�Yn0dS)N)�name�@)r=�creds)r'�Credentials�Namer<�joinr(ZNameTypeZhostbased_serviceZSecurityContext�step�raw�miscZGSSErrorr*r)rr
r?r:r=�context��gssapir	r
r�s 
�
�z+_get_gssapi_mechanism.<locals>.GSSAPI.start)Nr%FF)	rrrrrrr"r<rr	rGr	r
�GSSAPIds�
	rI)rHZgssapi.raw.misc�ImportErrorr)r,rIr	rGr
�_get_gssapi_mechanismOs
5rKc@seZdZdZdZdd�ZdS)�EXTERNALz�EXTERNAL SASL mechanism.

    Enables external authentication, i.e. not handled through this protocol.
    Only passes 'EXTERNAL' as authentication mechanism, but no further
    authentication data.
    sEXTERNALcCsdS)N�r	rr	r	r
r�szEXTERNAL.startN)rrrrrrr	r	r	r
rL�srLc@s$eZdZdZdZdd�Zdd�ZdS)�RAWz�A generic custom SASL mechanism.

    This mechanism takes a mechanism name and response to send to the server,
    so can be used for simple custom authentication schemes.
    NcCs:t|t�sJ�t|t�sJ�|||_|_t�dt�dS)NznPassing login_method and login_response to Connection is deprecated. Please implement a SASL subclass instead.)r.r/r�response�warnings�warn�DeprecationWarning)rrrOr	r	r
r�s�zRAW.__init__cCs|jSr)rOrr	r	r
r�sz	RAW.startr+r	r	r	r
rN�srN)rr3rP�iorZamqp.serializationrrrr#rKrIrLrNr	r	r	r
�<module>sM