HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib64/python3.10/site-packages/__pycache__/google_auth_httplib2.cpython-310.pyc
o

�h�'�@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�G/usr/local/CyberCP/lib/python3.10/site-packages/google_auth_httplib2.py�__init__(s
z_Response.__init__cC�|jjS)zint: The HTTP status code.)r
�status�rrrrr,�z_Response.statuscCs
t|j�S)z-Mapping[str, str]: The HTTP response headers.)�dictr
rrrr�headers1s
z_Response.headerscCs|jS)zbytes: The response body.)rrrrrr6sz_Response.dataN)	�__name__�
__module__�__qualname__�__doc__r�propertyrrrrrrrr s

rc@s$eZdZdZdd�Z	ddd�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rrrrrUs
zRequest.__init__�GETNc

Ksz|dur	t�d�zt�d||�|jj|f|||d�|��\}}t||�WStjtjj	fy<}	zt
�|	��d}	~	ww)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�httplib2�
HttpLib2Error�client�
HTTPExceptionr�TransportError)
r�urlr r!r�timeout�kwargsr
r�excrrr�__call__Xs$���
�
��zRequest.__call__)rNNN)rrrrrr/rrrrr<s
�rcCst��S)z)Returns a default httplib2.Http instance.)r&�Httprrrr�_make_default_http�sr1c@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|durt�}||_||_||_||_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)r1r�credentials�_refresh_status_codes�_max_refresh_attemptsr�_request)rr3r�refresh_status_codes�max_refresh_attemptsrrrr�szAuthorizedHttp.__init__cCs|j��dS)zCalls httplib2's Http.closeN)r�closerrrrr9�szAuthorizedHttp.closerc
s�|�dd�}|dur|��ni}	|j�|j|||	�d}
t�fdd�tD��r+���}
|jj	||f�|	||d�|��\}}|j
|jvrv||jkrvt
�d|j
|d|j�|j�|j�|
durd��|
�|j	||f�||||dd	�|��S||fS)
z*Implementation of httplib2's Http.request.�_credential_refresh_attemptrNc3s�|]	}t�|d�VqdSr	)�getattr)�.0�stream_prop�r!rr�	<genexpr>�s�z)AuthorizedHttp.request.<locals>.<genexpr>)r!r�redirections�connection_typez;Refreshing credentials due to a %s response. Attempt %s/%s.�)r!rr@rAr:)�pop�copyr3�before_requestr6�all�_STREAM_PROPERTIESrrr%rr4r5r"�info�refreshr)
r�urir r!rr@rAr-r:�request_headers�body_stream_positionr
�contentrr>rr%�sR��
�
�
���zAuthorizedHttp.requestcCs|jj||||d�dS)z'Proxy to httplib2.Http.add_certificate.)�passwordN)r�add_certificate)r�key�cert�domainrNrrrrO	szAuthorizedHttp.add_certificatecCr)�#Proxy to httplib2.Http.connections.�r�connectionsrrrrrU
rzAuthorizedHttp.connectionscC�||j_dS)rSNrT�r�valuerrrrU�cCr)�(Proxy to httplib2.Http.follow_redirects.�r�follow_redirectsrrrrr\rzAuthorizedHttp.follow_redirectscCrV)rZNr[rWrrrr\rYcCr)�Proxy to httplib2.Http.timeout.�rr,rrrrr,!rzAuthorizedHttp.timeoutcCrV)r]Nr^rWrrrr,&rYcCr)�&Proxy to httplib2.Http.redirect_codes.�r�redirect_codesrrrrra+rzAuthorizedHttp.redirect_codescCrV)r_Nr`rWrrrra0rYr	)rrrrr�DEFAULT_REFRESH_STATUS_CODES�DEFAULT_MAX_REFRESH_ATTEMPTSrr9r&�DEFAULT_MAX_REDIRECTSr%rOrrU�setterr\r,rarrrrr2�s<
� 
�
J






r2)r�
__future__r�http.clientr�logging�google.authrrr&�	getLoggerrr"rG�Responserrr1�objectr2rrrr�<module>s
E