/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/clients/__pycache__
Edit: /usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/clients/__pycache__/base.cpython-310.pyc (23519B)
o
ag @ s d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m
Z
ddlmZm
Z
ddlmZmZmZ ddlmZ dZd Zd
ZddiZG d
d dZdS )z
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming OAuth 2.0 RFC6749.
N)generate_token)tokens)InsecureTransportErrorTokenExpiredError)parse_token_responseprepare_token_request prepare_token_revocation_request)is_secure_transportauth_headerquerybodyzContent-Typez!application/x-www-form-urlencodedc @ s e Zd ZdZdZedddddddddedddfddZedd Z d d
Z
dd Zd
d Z d.ddZ
d/ddZ d0ddZ d1ddZ d2ddZd3ddZd4ddZ d.d d!Zd"d# Zd3d$d%Zdddedfd&d'Zd(d) Zd*d+ Zd,d- ZdS )5Clienta Base OAuth2 client responsible for access token management.
This class also acts as a generic interface providing methods common to all
client types such as ``prepare_authorization_request`` and
``prepare_token_revocation_request``. The ``prepare_x_request`` methods are
the recommended way of interacting with clients (as opposed to the abstract
prepare uri/body/etc methods). They are recommended over the older set
because they are easier to use (more consistent) and add a few additional
security checks, such as HTTPS and state checking.
Some of these methods require further implementation only provided by the
specific purpose clients such as
:py:class:`oauthlib.oauth2.MobileApplicationClient` and thus you should always
seek to use the client class matching the OAuth workflow you need. For
Python, this is usually :py:class:`oauthlib.oauth2.WebApplicationClient`.
refresh_tokenBearerNc K s || _ || _|| _|| _|| _|| _|| _|pi | _| | _|| _ |
| _
|| _|
| _|| _
|| _d| _d| _d| _| | j dS )ae Initialize a client with commonly used attributes.
:param client_id: Client identifier given by the OAuth provider upon
registration.
:param default_token_placement: Tokens can be supplied in the Authorization
header (default), the URL query component (``query``) or the request
body (``body``).
:param token_type: OAuth 2 token type. Defaults to Bearer. Change this
if you specify the ``access_token`` parameter and know it is of a
different token type, such as a MAC, JWT or SAML token. Can
also be supplied as ``token_type`` inside the ``token`` dict parameter.
:param access_token: An access token (string) used to authenticate
requests to protected resources. Can also be supplied inside the
``token`` dict parameter.
:param refresh_token: A refresh token (string) used to refresh expired
tokens. Can also be supplied inside the ``token`` dict parameter.
:param mac_key: Encryption key used with MAC tokens.
:param mac_algorithm: Hashing algorithm for MAC tokens.
:param token: A dict of token attributes such as ``access_token``,
``token_type`` and ``expires_at``.
:param scope: A list of default scopes to request authorization for.
:param state: A CSRF protection string used during authorization.
:param redirect_url: The redirection endpoint on the client side to which
the user returns after authorization.
:param state_generator: A no argument state generation callable. Defaults
to :py:meth:`oauthlib.common.generate_token`.
:param code_verifier: PKCE parameter. A cryptographically random string that is used to correlate the
authorization request to the token request.
:param code_challenge: PKCE parameter. A challenge derived from the code verifier that is sent in the
authorization request, to be verified against later.
:param code_challenge_method: PKCE parameter. A method that was used to derive code challenge.
Defaults to "plain" if not present in the request.
N) client_iddefault_token_placement
token_typeaccess_tokenr mac_key
mac_algorithmtokenscopestate_generatorstateredirect_url
code_verifiercode_challengecode_challenge_methodcode
expires_in_expires_atpopulate_token_attributes)selfr r r r r r r r r r r r r r r kwargs r$ F/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/clients/base.py__init__8 s&