File: //opt/cppython/lib/python3.8/site-packages/oauth2client/__pycache__/service_account.cpython-38.pyc
U
KD�g#n � @ s� d Z ddlZddlZddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddlm
Z
dZdZd Z
G d
d� dej�Zdd
� ZG dd� de�ZdS )z/oauth2client Service account credentials class.� N)�_helpers)�client)�crypt)� transportZ
notasecret�_private_key_pkcs12a
This library only implements PKCS#12 support via the pyOpenSSL library.
Either install pyOpenSSL, or please convert the .p12 file
to .pem format:
$ cat key.p12 | \
> openssl pkcs12 -nodes -nocerts -passin pass:notasecret | \
> openssl rsa > key.pem
c s. e Zd ZdZdZedg�ejjB ZdZ dZ
dZddddej
ejf� fdd� Zd(� fdd � Zed)d
d��Zed*dd
��Zed+dd��Zeddej
ejfdd��Zeddej
ejfdd��Zeddej
ejfdd��Zdd� Zdd� Zedd� �Zedd� �Zedd� �Zd d!� Zd"d#� Zd$d%� Z d&d'� Z!� Z"S ),�ServiceAccountCredentialsa� Service Account credential for OAuth 2.0 signed JWT grants.
Supports
* JSON keyfile (typically contains a PKCS8 key stored as
PEM text)
* ``.p12`` key (stores PKCS12 key and certificate)
Makes an assertion to server using a signed JWT assertion in exchange
for an access token.
This credential does not require a flow to instantiate because it
represents a two legged flow, and therefore has all of the required
information to generate and refresh its own access tokens.
Args:
service_account_email: string, The email associated with the
service account.
signer: ``crypt.Signer``, A signer which can be used to sign content.
scopes: List or string, (Optional) Scopes to use when acquiring
an access token.
private_key_id: string, (Optional) Private key identifier. Typically
only used with a JSON keyfile. Can be sent in the
header of a JWT token assertion.
client_id: string, (Optional) Client ID for the project that owns the
service account.
user_agent: string, (Optional) User agent to use when sending
request.
token_uri: string, URI for token endpoint. For convenience defaults
to Google's endpoints but any OAuth 2.0 provider can be
used.
revoke_uri: string, URI for revoke endpoint. For convenience defaults
to Google's endpoints but any OAuth 2.0 provider can be
used.
kwargs: dict, Extra key-value pairs (both strings) to send in the
payload body when making an assertion.
� �_signerN� c
sL t t| �jd |||d� || _|| _t�|�| _|| _|| _ || _
| | _d S )N)�
user_agent� token_uri�
revoke_uri)�superr �__init__�_service_account_emailr r Zscopes_to_string�_scopes�_private_key_id� client_id�_user_agent�_kwargs)
�self�service_account_email�signer�scopes�private_key_idr r r r
�kwargs�� __class__� �I/opt/cppython/lib/python3.8/site-packages/oauth2client/service_account.pyr _ s
�z"ServiceAccountCredentials.__init__c sH |dkrt � | j�}|�t�}|dk r4t�|�|t<