File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/google/oauth2/__pycache__/utils.cpython-310.pyc
Back
o �h� � @ sr d Z ddlZddlZddlZddlZddlmZ G dd� dej�ZG dd� de �Z G dd � d ejd �Zdd� Z dS ) a' OAuth 2.0 Utilities. This module provides implementations for various OAuth 2.0 utilities. This includes `OAuth error handling`_ and `Client authentication for OAuth flows`_. OAuth error handling -------------------- This will define interfaces for handling OAuth related error responses as stated in `RFC 6749 section 5.2`_. This will include a common function to convert these HTTP error responses to a :class:`google.auth.exceptions.OAuthError` exception. Client authentication for OAuth flows ------------------------------------- We introduce an interface for defining client authentication credentials based on `RFC 6749 section 2.3.1`_. This will expose the following capabilities: * Ability to support basic authentication via request header. * Ability to support bearer token authentication via request header. * Ability to support client ID / secret authentication via request body. .. _RFC 6749 section 2.3.1: https://tools.ietf.org/html/rfc6749#section-2.3.1 .. _RFC 6749 section 5.2: https://tools.ietf.org/html/rfc6749#section-5.2 � N)� exceptionsc @ s e Zd ZdZdZdS )�ClientAuthType� � N)�__name__� __module__�__qualname__�basic�request_body� r r �I/usr/local/CyberPanel/lib/python3.10/site-packages/google/oauth2/utils.pyr 5 s r c @ s e Zd ZdZddd�ZdS )�ClientAuthenticationz�Defines the client authentication credentials for basic and request-body types based on https://tools.ietf.org/html/rfc6749#section-2.3.1. Nc C s || _ || _|| _dS )a� Instantiates a client authentication object containing the client ID and secret credentials for basic and response-body auth. Args: client_auth_type (google.oauth2.oauth_utils.ClientAuthType): The client authentication type. client_id (str): The client ID. client_secret (Optional[str]): The client secret. N)�client_auth_type� client_id� client_secret)�selfr r r r r r �__init__? s zClientAuthentication.__init__�N)r r r �__doc__r r r r r r : s r c s@ e Zd ZdZd� fdd� Z ddd�Zddd�Zd d � Z� ZS ) �OAuthClientAuthHandlerzUAbstract class for handling client authentication in OAuth-based operations. Nc s t t| ��� || _dS )z�Instantiates an OAuth client authentication handler. Args: client_authentication (Optional[google.oauth2.utils.ClientAuthentication]): The OAuth client authentication credentials if available. N)�superr r �_client_authentication)r �client_authentication�� __class__r r r S s zOAuthClientAuthHandler.__init__c C s&