SlyAPI.oauth2#
Implementation for OAuth2.0 with PKCE as the Auth interface https://datatracker.ietf.org/doc/html/rfc7636
Functions
|
|
|
Mark a endpoint as requiring specific scopes to be used |
Classes
|
Provides the Auth interface implementation for OAuth2 |
|
|
|
- SlyAPI.oauth2.requires_scopes(*_scopes)[source]#
Mark a endpoint as requiring specific scopes to be used
- class SlyAPI.oauth2.OAuth2User(token: str, refresh_token: str, expires_at: datetime.datetime, token_type: str = 'Bearer', scopes: list[str] = <factory>)[source]#
Bases:
object
- Parameters:
- class SlyAPI.oauth2.OAuth2App(id: str, secret: str, auth_uri: str, token_uri: str)[source]#
Bases:
object
- classmethod from_json_obj(obj)[source]#
Read an app from a JSON object, either from the Google Console JSON format or a set of kwargs
- await refresh(client, user)[source]#
- Parameters:
client (ClientSession) –
user (OAuth2User) –
- class SlyAPI.oauth2.OAuth2(app, user, on_refresh=None)[source]#
Bases:
Auth
Provides the Auth interface implementation for OAuth2
Load an OAuth2 app and user from JSON files or existing objects.
- Parameters:
app (OAuth2App) –
user (OAuth2User) –
on_refresh (Callable[[OAuth2User], None] | None) –
- user: OAuth2User#