|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/google/oauth2/__pycache__/ |
U
O��gQa � @ s� d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddlm
Z
ddlmZ dd lm
Z
e�e�Zd
ZdZG dd
� d
e je j�ZG dd� de j�ZdS )a� OAuth 2.0 Credentials.
This module provides credentials based on OAuth 2.0 access and refresh tokens.
These credentials usually access resources on behalf of a user (resource
owner).
Specifically, this is intended to use access tokens acquired using the
`Authorization Code grant`_ and can refresh those tokens using a
optional `refresh token`_.
Obtaining the initial access and refresh token is outside of the scope of this
module. Consult `rfc6749 section 4.1`_ for complete details on the
Authorization Code grant flow.
.. _Authorization Code grant: https://tools.ietf.org/html/rfc6749#section-1.3.1
.. _refresh token: https://tools.ietf.org/html/rfc6749#section-6
.. _rfc6749 section 4.1: https://tools.ietf.org/html/rfc6749#section-4.1
� )�datetimeN)�
_cloud_sdk)�_helpers)�credentials)�
exceptions)�metrics)�reauthz#https://oauth2.googleapis.com/tokenz'https://oauth2.googleapis.com/tokeninfoc s� e Zd ZdZddddddddddddddejdf� fdd� Zdd� Zdd � Ze d
d� �Z
e dd
� �Ze dd� �Ze dd� �Z
e dd� �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Ze dd� �Zejdd� �Ze dd � �Zd!d"� Ze�ej�d#d$� �Ze�ej�d%d&� �Ze�ej�d'd(� �Zd)d*� Ze�ej �d+d,� �Z!d-d.� Z"e�ej�d/d0� �Z#e$d7d1d2��Z%e$d8d3d4��Z&d9d5d6�Z'� Z(S ):�Credentialsa� Credentials using OAuth 2.0 access and refresh tokens.
The credentials are considered immutable except the tokens and the token
expiry, which are updated after refresh. If you want to modify the quota
project, use :meth:`with_quota_project` or ::
credentials = credentials.with_quota_project('myproject-123')
Reauth is disabled by default. To enable reauth, set the
`enable_reauth_refresh` parameter to True in the constructor. Note that
reauth feature is intended for gcloud to use only.
If reauth is enabled, `pyu2f` dependency has to be installed in order to use security
key reauth feature. Dependency can be installed via `pip install pyu2f` or `pip install
google-auth[reauth]`.
NFc s� t t| ��� || _|
| _|| _|| _|| _|| _|| _ || _
|| _|| _| | _
|| _|| _|
| _|| _|pptj| _|pzd| _d| _dS )a
Args:
token (Optional(str)): The OAuth 2.0 access token. Can be None
if refresh information is provided.
refresh_token (str): The OAuth 2.0 refresh token. If specified,
credentials can be refreshed.
id_token (str): The Open ID Connect ID Token.
token_uri (str): The OAuth 2.0 authorization server's token
endpoint URI. Must be specified for refresh, can be left as
None if the token can not be refreshed.
client_id (str): The OAuth 2.0 client ID. Must be specified for
refresh, can be left as None if the token can not be refreshed.
client_secret(str): The OAuth 2.0 client secret. Must be specified
for refresh, can be left as None if the token can not be
refreshed.
scopes (Sequence[str]): The scopes used to obtain authorization.
This parameter is used by :meth:`has_scopes`. OAuth 2.0
credentials can not request additional scopes after
authorization. The scopes must be derivable from the refresh
token if refresh information is provided (e.g. The refresh
token scopes are a superset of this or contain a wild card
scope like 'https://www.googleapis.com/auth/any-api').
default_scopes (Sequence[str]): Default scopes passed by a
Google client library. Use 'scopes' for user-defined scopes.
quota_project_id (Optional[str]): The project ID used for quota and billing.
This project may be different from the project used to
create the credentials.
rapt_token (Optional[str]): The reauth Proof Token.
refresh_handler (Optional[Callable[[google.auth.transport.Request, Sequence[str]], [str, datetime]]]):
A callable which takes in the HTTP request callable and the list of
OAuth scopes and when called returns an access token string for the
requested scopes and its expiry datetime. This is useful when no
refresh tokens are provided and tokens are obtained by calling
some external process on demand. It is particularly useful for
retrieving downscoped tokens from a token broker.
enable_reauth_refresh (Optional[bool]): Whether reauth refresh flow
should be used. This flag is for gcloud to use only.
granted_scopes (Optional[Sequence[str]]): The scopes that were consented/granted by the user.
This could be different from the requested scopes and it could be empty if granted
and requested scopes were same.
trust_boundary (str): String representation of trust boundary meta.
universe_domain (Optional[str]): The universe domain. The default
universe domain is googleapis.com.
account (Optional[str]): The account associated with the credential.
� N)�superr �__init__�token�expiry�_refresh_token� _id_token�_scopes�_default_scopes�_granted_scopes�
_token_uri�
_client_id�_client_secret�_quota_project_id�_rapt_token�refresh_handler�_enable_reauth_refresh�_trust_boundaryr �DEFAULT_UNIVERSE_DOMAIN�_universe_domain�_account�_cred_file_path)�selfr
�
refresh_token�id_token� token_uri� client_id�
client_secret�scopes�default_scopes�quota_project_idr �
rapt_tokenr �enable_reauth_refresh�granted_scopes�trust_boundary�universe_domain�account�� __class__� �F/opt/cppython/lib/python3.8/site-packages/google/oauth2/credentials.pyr J s&