File: //usr/local/CyberPanel/lib64/python3.10/site-packages/google/oauth2/__pycache__/sts.cpython-310.pyc
o
��h+ � @ sJ d Z ddlmZ ddlZddlZddlmZ ddiZG dd� dej �Z
dS )a� OAuth 2.0 Token Exchange Spec.
This module defines a token exchange utility based on the `OAuth 2.0 Token
Exchange`_ spec. This will be mainly used to exchange external credentials
for GCP access tokens in workload identity pools to access Google APIs.
The implementation will support various types of client authentication as
allowed in the spec.
A deviation on the spec will be for additional Google specific options that
cannot be easily mapped to parameters defined in the RFC.
The returned dictionary response will be based on the `rfc8693 section 2.2.1`_
spec JSON response.
.. _OAuth 2.0 Token Exchange: https://tools.ietf.org/html/rfc8693
.. _rfc8693 section 2.2.1: https://tools.ietf.org/html/rfc8693#section-2.2.1
� N)�utilszContent-Typez!application/x-www-form-urlencodedc sL e Zd ZdZd� fdd� Zdd� Z ddd�Zd d
� Z� ZS )
�ClientzcImplements the OAuth 2.0 token exchange spec based on
https://tools.ietf.org/html/rfc8693.
Nc s t t| ��|� || _dS )a5 Initializes an STS client instance.
Args:
token_exchange_endpoint (str): The token exchange endpoint.
client_authentication (Optional(google.oauth2.oauth2_utils.ClientAuthentication)):
The optional OAuth client authentication credentials if available.
N)�superr �__init__�_token_exchange_endpoint)�self�token_exchange_endpoint�client_authentication�� __class__� �G/usr/local/CyberPanel/lib/python3.10/site-packages/google/oauth2/sts.pyr 1 s
zClient.__init__c
C s� t �� }|rt|��� D ]\}}|||<