Skip to content

Commit

Permalink
update dcaa13b
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTheDocs authored and BuildTheDocs committed Sep 9, 2024
0 parents commit 12a8315
Show file tree
Hide file tree
Showing 61 changed files with 13,724 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 10e0c696388a5134724b0005cefbdeef
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
334 changes: 334 additions & 0 deletions _modules/aiohttp_oauth2_client/client.html

Large diffs are not rendered by default.

419 changes: 419 additions & 0 deletions _modules/aiohttp_oauth2_client/grant/authorization_code.html

Large diffs are not rendered by default.

358 changes: 358 additions & 0 deletions _modules/aiohttp_oauth2_client/grant/client_credentials.html

Large diffs are not rendered by default.

433 changes: 433 additions & 0 deletions _modules/aiohttp_oauth2_client/grant/common.html

Large diffs are not rendered by default.

394 changes: 394 additions & 0 deletions _modules/aiohttp_oauth2_client/grant/device_code.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions _modules/aiohttp_oauth2_client/models/errors.html

Large diffs are not rendered by default.

309 changes: 309 additions & 0 deletions _modules/aiohttp_oauth2_client/models/grant.html

Large diffs are not rendered by default.

345 changes: 345 additions & 0 deletions _modules/aiohttp_oauth2_client/models/pkce.html

Large diffs are not rendered by default.

484 changes: 484 additions & 0 deletions _modules/aiohttp_oauth2_client/models/request.html

Large diffs are not rendered by default.

365 changes: 365 additions & 0 deletions _modules/aiohttp_oauth2_client/models/response.html

Large diffs are not rendered by default.

357 changes: 357 additions & 0 deletions _modules/aiohttp_oauth2_client/models/token.html

Large diffs are not rendered by default.

305 changes: 305 additions & 0 deletions _modules/index.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions _sources/api.client.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Client
======

.. automodule:: aiohttp_oauth2_client.client
:members:
:undoc-members:
:show-inheritance:
49 changes: 49 additions & 0 deletions _sources/api.grant.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Grants
=============


The :obj:`~aiohttp_oauth2_client.grant.common.OAuth2Grant` abstract class defines the high-level interface for OAuth 2.0 grant implementations.
The grant object should be used as an async context manager.

Common
------
.. automodule:: aiohttp_oauth2_client.grant.common
:members:
:undoc-members:
:show-inheritance:


Authorization Code
------------------

.. automodule:: aiohttp_oauth2_client.grant.authorization_code
:members:
:undoc-members:
:show-inheritance:


Client Credentials
------------------

.. automodule:: aiohttp_oauth2_client.grant.client_credentials
:members:
:undoc-members:
:show-inheritance:


Resource Owner Password Credentials
-----------------------------------

.. automodule:: aiohttp_oauth2_client.grant.resource_owner_password_credentials
:members:
:undoc-members:
:show-inheritance:


Device Code
-----------

.. automodule:: aiohttp_oauth2_client.grant.device_code
:members:
:undoc-members:
:show-inheritance:
57 changes: 57 additions & 0 deletions _sources/api.models.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Models
======

The **models** package contains several data models and exceptions that are internally used throughout the code.
End-users shouldn't have to deal with these classes, except for error handling.


Errors
------

All exceptions raised in the `aiohttp-oauth2-client` package inherit from the :obj:`aiohttp_oauth2_client.models.errors.AuthError` exception.
This can be useful for catching auth errors in your code.

.. automodule:: aiohttp_oauth2_client.models.errors
:members:
:undoc-members:
:show-inheritance:

Grant types
-----------

.. automodule:: aiohttp_oauth2_client.models.grant
:members:
:undoc-members:
:show-inheritance:

Proof Key for Code Exchange (PKCE)
----------------------------------

.. automodule:: aiohttp_oauth2_client.models.pkce
:members:
:undoc-members:
:show-inheritance:

Request
---------------------------------------------

.. automodule:: aiohttp_oauth2_client.models.request
:members:
:undoc-members:
:show-inheritance:

Response
----------------------------------------------

.. automodule:: aiohttp_oauth2_client.models.response
:members:
:undoc-members:
:show-inheritance:

Token
-------------------------------------------

.. automodule:: aiohttp_oauth2_client.models.token
:members:
:undoc-members:
:show-inheritance:
16 changes: 16 additions & 0 deletions _sources/api.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
API
===

.. automodule:: aiohttp_oauth2_client
:members:
:undoc-members:
:show-inheritance:



.. toctree::
:maxdepth: 3

api.client
api.grant
api.models
37 changes: 37 additions & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. aiohttp-oauth2-client documentation master file, created by
sphinx-quickstart on Tue May 21 16:32:43 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
``aiohttp-oauth2-client``: OAuth2 support for ``aiohttp`` client
================================================================
This package adds support for OAuth 2.0 authorization to the :obj:`~aiohttp.ClientSession` class of the ``aiohttp`` library.
It handles retrieving access tokens and injects them in the *Authorization* header of HTTP requests as a Bearer token.

**Features**:

* Ease of use
* Supported OAuth2 grants:

* `Resource Owner Password Credentials <https://datatracker.ietf.org/doc/html/rfc6749#section-4.3>`_
* `Client Credentials <https://datatracker.ietf.org/doc/html/rfc6749#section-4.4>`_
* `Authorization Code (+ PKCE) <https://datatracker.ietf.org/doc/html/rfc6749#section-4.1>`_
* `Device Code (+ PKCE) <https://datatracker.ietf.org/doc/html/rfc8628>`_
* Automatic (lazy) refresh of tokens
* Extensible code architecture

.. toctree::
:maxdepth: 2
:caption: Contents:

installation
usage
api


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions _sources/installation.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Installation
============

This package is available on `PyPi <https://pypi.org/project/aiohttp-oauth2-client/>`_ and can be installed using ``pip``::

pip install aiohttp-oauth2-client

45 changes: 45 additions & 0 deletions _sources/usage.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Usage
=====

Getting started
---------------

Begin by importing the relevant modules, like the OAuth2 client and grant. Also import ``asyncio`` for running async code::

import asyncio
from aiohttp_oauth2_client.client import OAuth2Client
from aiohttp_oauth2_client.grant.device_code import DeviceCodeGrant


Then create an :obj:`~aiohttp_oauth2_client.grant.common.OAuth2Grant` and :obj:`~aiohttp_oauth2_client.client.OAuth2Client` object and perform a HTTP request to a protected resource. We use the
Device Code grant in this example::

async def main():
async with DeviceCodeGrant(
token_url=TOKEN_URL,
device_authorization_url=DEVICE_AUTHORIZATION_URL,
client_id=CLIENT_ID,
pkce=True
) as grant, OAuth2Client(grant) as client:
async with client.get(PROTECTED_ENDPOINT) as response:
assert response.ok
print(await response.text())


asyncio.run(main())


The client and grant objects can be used as async context managers. This ensures the proper setup and cleanup of
associated resources.


Grant configuration
-------------------
Each grant type has specific configuration options associated with it.
Extra parameters can be provided, which will then be used in the authorization process.

* :obj:`~aiohttp_oauth2_client.grant.authorization_code.AuthorizationCodeGrant`
* :obj:`~aiohttp_oauth2_client.grant.client_credentials.ClientCredentialsGrant`
* :obj:`~aiohttp_oauth2_client.grant.resource_owner_password_credentials.ResourceOwnerPasswordCredentialsGrant`
* :obj:`~aiohttp_oauth2_client.grant.device_code.DeviceCodeGrant`

11 changes: 11 additions & 0 deletions _static/autodoc_pydantic.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.autodoc_pydantic_validator_arrow {
padding-left: 8px;
}

.autodoc_pydantic_collapsable_json {
cursor: pointer;
}

.autodoc_pydantic_collapsable_erd {
cursor: pointer;
}
Loading

0 comments on commit 12a8315

Please sign in to comment.