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/google/auth/__pycache__/_oauth2client.cpython-38.pyc
U

KD�g��
@s"dZddlmZddlmZddlZddlZddlZddl	Zzddl
ZddlZddl
ZWn,ek
r�Zzed�e�W5dZ[XYnXzddlZdZWnek
r�dZYnXdZd	d
�Zdd�Zd
d�Zdd�ZejjeejjeejjeejjeejjjeiZ e�ree ejj!j<dd�Z"dS)z�Helpers for transitioning from oauth2client to google-auth.

.. warning::
    This module is private as it is intended to assist first-party downstream
    clients with the transition from oauth2client to google-auth.
�)�absolute_import)�_helpersNzoauth2client is not installed.TFz8Unable to convert {} to a google-auth credentials class.cCs2tjjj|j|j|j|j|j|j	d�}|j
|_|S)aBConverts to :class:`google.oauth2.credentials.Credentials`.

    Args:
        credentials (Union[oauth2client.client.OAuth2Credentials,
            oauth2client.client.GoogleCredentials]): The credentials to
            convert.

    Returns:
        google.oauth2.credentials.Credentials: The converted credentials.
    )�token�
refresh_token�	token_uri�	client_id�
client_secret�scopes)�google�oauth2�credentials�CredentialsZaccess_tokenrrrrr	Ztoken_expiryZ_expires)rZnew_credentials�r�F/opt/cppython/lib/python3.8/site-packages/google/auth/_oauth2client.py�_convert_oauth2_credentials0s�	rcCs$|j��}|j|d<tjjj�|�S)auConverts to :class:`google.oauth2.service_account.Credentials`.

    Args:
        credentials (Union[
            oauth2client.service_account.ServiceAccountCredentials,
            oauth2client.service_account._JWTAccessCredentials]): The
            credentials to convert.

    Returns:
        google.oauth2.service_account.Credentials: The converted credentials.
    r)Zserialization_data�copyrr
r�service_accountr
Zfrom_service_account_info)r�inforrr�$_convert_service_account_credentialsIs

rcCstjjj|jd�S)aConverts to :class:`google.auth.compute_engine.Credentials`.

    Args:
        credentials (oauth2client.contrib.gce.AppAssertionCredentials): The
            credentials to convert.

    Returns:
        google.oauth2.service_account.Credentials: The converted credentials.
    )�service_account_email)r
�authZcompute_enginer
r�rrrr�&_convert_gce_app_assertion_credentialsZs
�rcCstjjjt�|j�|jd�S)aConverts to :class:`google.auth.app_engine.Credentials`.

    Args:
        credentials (oauth2client.contrib.app_engine.AppAssertionCredentials):
            The credentials to convert.

    Returns:
        google.oauth2.service_account.Credentials: The converted credentials.
    )r	�service_account_id)r
rZ
app_enginer
rZstring_to_scopes�scoperrrrr�,_convert_appengine_app_assertion_credentialsis
�rc
CsRt|�}zt||�WStk
rL}ztt�|��}||�W5d}~XYnXdS)a�Convert oauth2client credentials to google-auth credentials.

    This class converts:

    - :class:`oauth2client.client.OAuth2Credentials` to
      :class:`google.oauth2.credentials.Credentials`.
    - :class:`oauth2client.client.GoogleCredentials` to
      :class:`google.oauth2.credentials.Credentials`.
    - :class:`oauth2client.service_account.ServiceAccountCredentials` to
      :class:`google.oauth2.service_account.Credentials`.
    - :class:`oauth2client.service_account._JWTAccessCredentials` to
      :class:`google.oauth2.service_account.Credentials`.
    - :class:`oauth2client.contrib.gce.AppAssertionCredentials` to
      :class:`google.auth.compute_engine.Credentials`.
    - :class:`oauth2client.contrib.appengine.AppAssertionCredentials` to
      :class:`google.auth.app_engine.Credentials`.

    Returns:
        google.auth.credentials.Credentials: The converted credentials.

    Raises:
        ValueError: If the credentials could not be converted.
    N)�type�_CLASS_CONVERSION_MAP�KeyError�
ValueError�_CONVERT_ERROR_TMPL�format)rZcredentials_class�
caught_exc�new_excrrr�convert�sr$)#�__doc__�
__future__rZgoogle.authrZgoogle.auth.app_enginer
Zgoogle.auth.compute_engineZgoogle.oauth2.credentialsZgoogle.oauth2.service_accountZoauth2client.clientZoauth2clientZoauth2client.contrib.gceZoauth2client.service_account�ImportErrorr"Zoauth2client.contrib.appengineZ_HAS_APPENGINEr rrrr�clientZOAuth2CredentialsZGoogleCredentialsrZServiceAccountCredentialsZ_JWTAccessCredentials�contribZgceZAppAssertionCredentialsrZ	appenginer$rrrr�<module>sN
���