File: //opt/cppython/lib/python3.8/site-packages/google/auth/__pycache__/identity_pool.cpython-38.pyc
U
KD�g.I � @ s� d Z zddlmZ W n ek
r4 ddlmZ Y nX ddlZddlZddlZddlm Z ddl
mZ ddl
mZ ddl
m
Z
ddlmZ G d d
� d
ejd�ZG dd
� d
e �ZG dd� de�ZG dd� de�ZG dd� de�Zddd�ZG dd� de
j�ZdS )a= Identity Pool Credentials.
This module provides credentials to access Google Cloud resources from on-prem
or non-Google Cloud platforms which support external credentials (e.g. OIDC ID
tokens) retrieved from local file locations or local servers. This includes
Microsoft Azure and OIDC identity providers (e.g. K8s workloads registered with
Hub with Hub workload identity enabled).
These credentials are recommended over the use of service account credentials
in on-prem/non-Google Cloud platforms as they do not involve the management of
long-live service account private keys.
Identity Pool Credentials are initialized using external_account
arguments which are typically loaded from an external credentials file or
an external credentials URL.
This module also provides a definition for an abstract subject token supplier.
This supplier can be implemented to return a valid OIDC or SAML2.0 subject token
and used to create Identity Pool credentials. The credentials will then call the
supplier instead of using pre-defined methods such as reading a local file or
calling a URL.
� )�MappingN)�
NamedTuple)�_helpers)�
exceptions)�external_account)�_mtls_helperc @ s e Zd ZdZejdd� �ZdS )�SubjectTokenSupplieraW Base class for subject token suppliers. This can be implemented with custom logic to retrieve
a subject token to exchange for a Google Cloud access token when using Workload or
Workforce Identity Federation. The identity pool credential does not cache the subject token,
so caching logic should be added in the implementation.
c C s t d��dS )a� Returns the requested subject token. The subject token must be valid.
.. warning: This is not cached by the calling Google credential, so caching logic should be implemented in the supplier.
Args:
context (google.auth.externalaccount.SupplierContext): The context object
containing information about the requested audience and subject token type.
request (google.auth.transport.Request): The object used to make
HTTP requests.
Raises:
google.auth.exceptions.RefreshError: If an error is encountered during
subject token retrieval logic.
Returns:
str: The requested subject token string.
� N)�NotImplementedError��self�context�request� r �F/opt/cppython/lib/python3.8/site-packages/google/auth/identity_pool.py�get_subject_token= s z&SubjectTokenSupplier.get_subject_tokenN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodr r r r r r 6 s r )� metaclassc @ s"