HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/__pycache__/google_auth_httplib2.cpython-38.pyc
U

LD�g�'�@s�dZddlmZddlZddlZddlmZddlmZddl	Z	e�
e�ZdZ
Gdd�dej�ZGd	d
�d
ej�Zdd�ZGd
d�de�ZdS)zTransport adapter for httplib2.�)�absolute_importN)�
exceptions)�	transport)�read�seek�tellc@s<eZdZdZdd�Zedd��Zedd��Zedd	��Zd
S)�	_Responsez�httplib2 transport response adapter.

    Args:
        response (httplib2.Response): The raw httplib2 response.
        data (bytes): The response body.
    cCs||_||_dS�N)�	_response�_data)�self�response�data�r�A/opt/cppython/lib/python3.8/site-packages/google_auth_httplib2.py�__init__(sz_Response.__init__cCs|jjS)zint: The HTTP status code.)r
�status�rrrrr,sz_Response.statuscCs
t|j�S)z-Mapping[str, str]: The HTTP response headers.)�dictr
rrrr�headers1sz_Response.headerscCs|jS)zbytes: The response body.)rrrrrr6sz_Response.dataN)	�__name__�
__module__�__qualname__�__doc__r�propertyrrrrrrrr s

rc@s"eZdZdZdd�Zddd�ZdS)	�Requesta�httplib2 request adapter.

    This class is used internally for making requests using various transports
    in a consistent way. If you use :class:`AuthorizedHttp` you do not need
    to construct or use this class directly.

    This class can be useful if you want to manually refresh a
    :class:`~google.auth.credentials.Credentials` instance::

        import google_auth_httplib2
        import httplib2

        http = httplib2.Http()
        request = google_auth_httplib2.Request(http)

        credentials.refresh(request)

    Args:
        http (httplib2.Http): The underlying http object to use to make
            requests.

    .. automethod:: __call__
    cCs
||_dSr	)�http)rrrrrrUszRequest.__init__�GETNc

Ks�|dk	rt�d�z:t�d||�|jj|f|||d�|��\}}t||�WStjtjj	fk
r�}	zt
�|	��W5d}	~	XYnXdS)a3Make an HTTP request using httplib2.

        Args:
            url (str): The URI to be requested.
            method (str): The HTTP method to use for the request. Defaults
                to 'GET'.
            body (bytes): The payload / body in HTTP request.
            headers (Mapping[str, str]): Request headers.
            timeout (Optional[int]): The number of seconds to wait for a
                response from the server. This is ignored by httplib2 and will
                issue a warning.
            kwargs: Additional arguments passed throught to the underlying
                :meth:`httplib2.Http.request` method.

        Returns:
            google.auth.transport.Response: The HTTP response.

        Raises:
            google.auth.exceptions.TransportError: If any exception occurred.
        Nzvhttplib2 transport does not support per-request timeout. Set the timeout when constructing the httplib2.Http instance.zMaking request: %s %s)�method�bodyr)�_LOGGER�warning�debugr�requestr�httplib2Z
HttpLib2Error�client�
HTTPExceptionrZTransportError)
r�urlrrr�timeout�kwargsr
r�excrrr�__call__Xs$����
zRequest.__call__)rNNN)rrrrrr+rrrrr<s�rcCst��S)z)Returns a default httplib2.Http instance.)r$ZHttprrrr�_make_default_http�sr,c@s�eZdZdZdejejfdd�Zdd�Zddde	j
dfdd	�Zdd
d�Ze
dd
��Zejdd
��Ze
dd��Zejdd��Ze
dd��Zejdd��Ze
dd��Zejdd��ZdS)�AuthorizedHttpa�A httplib2 HTTP class with credentials.

    This class is used to perform requests to API endpoints that require
    authorization::

        from google.auth.transport._httplib2 import AuthorizedHttp

        authed_http = AuthorizedHttp(credentials)

        response = authed_http.request(
            'https://www.googleapis.com/storage/v1/b')

    This class implements :meth:`request` in the same way as
    :class:`httplib2.Http` and can usually be used just like any other
    instance of :class:``httplib2.Http`.

    The underlying :meth:`request` implementation handles adding the
    credentials' headers to the request and refreshing credentials as needed.
    NcCs6|dkrt�}||_||_||_||_t|j�|_dS)a�
        Args:
            credentials (google.auth.credentials.Credentials): The credentials
                to add to the request.
            http (httplib2.Http): The underlying HTTP object to
                use to make requests. If not specified, a
                :class:`httplib2.Http` instance will be constructed.
            refresh_status_codes (Sequence[int]): Which HTTP status codes
                indicate that credentials should be refreshed and the request
                should be retried.
            max_refresh_attempts (int): The maximum number of times to attempt
                to refresh the credentials and retry the request.
        N)r,r�credentials�_refresh_status_codes�_max_refresh_attemptsr�_request)rr.rZrefresh_status_codesZmax_refresh_attemptsrrrr�szAuthorizedHttp.__init__cCs|j��dS)zCalls httplib2's Http.closeN)r�closerrrrr2�szAuthorizedHttp.closerc
s�|�dd�}|dk	r|��ni}	|j�|j|||	�d}
t�fdd�tD��rV���}
|jj	||f�|	||d�|��\}}|j
|jkr�||jkr�t
�d|j
|d|j�|j�|j�|
dk	rȈ�|
�|j	||f�||||dd	�|��S||fS)
z*Implementation of httplib2's Http.request.�_credential_refresh_attemptrNc3s|]}t�|d�VqdSr	)�getattr)�.0Zstream_prop�rrr�	<genexpr>�sz)AuthorizedHttp.request.<locals>.<genexpr>)rr�redirections�connection_typez;Refreshing credentials due to a %s response. Attempt %s/%s.�)rrr8r9r3)�pop�copyr.Zbefore_requestr1�all�_STREAM_PROPERTIESrrr#rr/r0r �info�refreshr)
r�urirrrr8r9r)r3Zrequest_headersZbody_stream_positionr
�contentrr6rr#�sV���

���
���zAuthorizedHttp.requestcCs|jj||||d�dS)z'Proxy to httplib2.Http.add_certificate.)�passwordN)r�add_certificate)r�key�cert�domainrCrrrrD	szAuthorizedHttp.add_certificatecCs|jjS)�#Proxy to httplib2.Http.connections.�r�connectionsrrrrrJ
szAuthorizedHttp.connectionscCs||j_dS)rHNrI�r�valuerrrrJscCs|jjS)�(Proxy to httplib2.Http.follow_redirects.�r�follow_redirectsrrrrrOszAuthorizedHttp.follow_redirectscCs||j_dS)rMNrNrKrrrrOscCs|jjS)�Proxy to httplib2.Http.timeout.�rr(rrrrr(!szAuthorizedHttp.timeoutcCs||j_dS)rPNrQrKrrrr(&scCs|jjS)�&Proxy to httplib2.Http.redirect_codes.�r�redirect_codesrrrrrT+szAuthorizedHttp.redirect_codescCs||j_dS)rRNrSrKrrrrT0s)N)rrrrrZDEFAULT_REFRESH_STATUS_CODESZDEFAULT_MAX_REFRESH_ATTEMPTSrr2r$ZDEFAULT_MAX_REDIRECTSr#rDrrJ�setterrOr(rTrrrrr-�s:�
 �
J







r-)r�
__future__r�http.clientr�loggingZgoogle.authrrr$�	getLoggerrr r>�Responserrr,�objectr-rrrr�<module>s
E