-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[Authlib] Add integrations dirs #15147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| version = "1.6.6" | ||
| upstream_repository = "https://github.com/lepture/authlib" | ||
| requires = ["cryptography"] | ||
| partial_stub = true | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
stubs/Authlib/authlib/integrations/django_client/__init__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from ..base_client import BaseOAuth, OAuthError as OAuthError | ||
| from .apps import DjangoOAuth1App as DjangoOAuth1App, DjangoOAuth2App as DjangoOAuth2App | ||
| from .integration import DjangoIntegration as DjangoIntegration, token_update as token_update | ||
|
|
||
| class OAuth(BaseOAuth): | ||
| oauth1_client_cls = DjangoOAuth1App | ||
| oauth2_client_cls = DjangoOAuth2App | ||
| framework_integration_cls = DjangoIntegration | ||
|
|
||
| __all__ = ["OAuth", "DjangoOAuth1App", "DjangoOAuth2App", "DjangoIntegration", "token_update", "OAuthError"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from ..base_client import BaseApp, OAuth1Mixin, OAuth2Mixin, OpenIDMixin | ||
| from ..requests_client import OAuth1Session, OAuth2Session | ||
|
|
||
| class DjangoAppMixin: | ||
| def save_authorize_data(self, request, **kwargs) -> None: ... | ||
| def authorize_redirect(self, request, redirect_uri=None, **kwargs): ... | ||
|
|
||
| class DjangoOAuth1App(DjangoAppMixin, OAuth1Mixin, BaseApp): | ||
| client_cls = OAuth1Session | ||
| def authorize_access_token(self, request, **kwargs): ... | ||
|
|
||
| class DjangoOAuth2App(DjangoAppMixin, OAuth2Mixin, OpenIDMixin, BaseApp): | ||
| client_cls = OAuth2Session | ||
| def authorize_access_token(self, request, **kwargs): ... |
11 changes: 11 additions & 0 deletions
11
stubs/Authlib/authlib/integrations/django_client/integration.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from ..base_client import FrameworkIntegration | ||
|
|
||
| # actual type is django.dispatch.Signal | ||
| token_update: Incomplete | ||
|
|
||
| class DjangoIntegration(FrameworkIntegration): | ||
| def update_token(self, token, refresh_token=None, access_token=None) -> None: ... | ||
| @staticmethod | ||
| def load_config(oauth, name, params): ... |
4 changes: 4 additions & 0 deletions
4
stubs/Authlib/authlib/integrations/django_oauth1/__init__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from .authorization_server import BaseServer as BaseServer, CacheAuthorizationServer as CacheAuthorizationServer | ||
| from .resource_protector import ResourceProtector as ResourceProtector | ||
|
|
||
| __all__ = ["BaseServer", "CacheAuthorizationServer", "ResourceProtector"] |
26 changes: 26 additions & 0 deletions
26
stubs/Authlib/authlib/integrations/django_oauth1/authorization_server.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import logging | ||
| from _typeshed import Incomplete | ||
|
|
||
| from authlib.oauth1 import AuthorizationServer as _AuthorizationServer, OAuth1Request, TemporaryCredential | ||
|
|
||
| log: logging.Logger | ||
|
|
||
| class BaseServer(_AuthorizationServer): | ||
| token_generator: Incomplete | ||
| client_model: Incomplete | ||
| token_model: Incomplete | ||
| SUPPORTED_SIGNATURE_METHODS: Incomplete | ||
| def __init__(self, client_model, token_model, token_generator=None) -> None: ... | ||
| def get_client_by_id(self, client_id): ... | ||
| def exists_nonce(self, nonce, request) -> bool: ... | ||
| def create_token_credential(self, request): ... | ||
| def check_authorization_request(self, request) -> OAuth1Request: ... | ||
| def create_oauth1_request(self, request) -> OAuth1Request: ... | ||
| def handle_response(self, status_code, payload, headers): ... | ||
|
|
||
| class CacheAuthorizationServer(BaseServer): | ||
| def __init__(self, client_model, token_model, token_generator=None) -> None: ... | ||
| def create_temporary_credential(self, request) -> TemporaryCredential: ... | ||
| def get_temporary_credential(self, request) -> TemporaryCredential | None: ... | ||
| def delete_temporary_credential(self, request) -> None: ... | ||
| def create_authorization_verifier(self, request) -> str: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| def exists_nonce_in_cache(nonce, request, timeout) -> bool: ... |
14 changes: 14 additions & 0 deletions
14
stubs/Authlib/authlib/integrations/django_oauth1/resource_protector.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from authlib.oauth1 import ResourceProtector as _ResourceProtector | ||
|
|
||
| class ResourceProtector(_ResourceProtector): | ||
| client_model: Incomplete | ||
| token_model: Incomplete | ||
| SUPPORTED_SIGNATURE_METHODS: Incomplete | ||
| def __init__(self, client_model, token_model) -> None: ... | ||
| def get_client_by_id(self, client_id): ... | ||
| def get_token_credential(self, request): ... | ||
| def exists_nonce(self, nonce, request) -> bool: ... | ||
| def acquire_credential(self, request): ... | ||
| def __call__(self, realm=None): ... |
8 changes: 8 additions & 0 deletions
8
stubs/Authlib/authlib/integrations/django_oauth2/__init__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from .authorization_server import AuthorizationServer as AuthorizationServer | ||
| from .endpoints import RevocationEndpoint as RevocationEndpoint | ||
| from .resource_protector import BearerTokenValidator as BearerTokenValidator, ResourceProtector as ResourceProtector | ||
| from .signals import ( | ||
| client_authenticated as client_authenticated, | ||
| token_authenticated as token_authenticated, | ||
| token_revoked as token_revoked, | ||
| ) |
24 changes: 24 additions & 0 deletions
24
stubs/Authlib/authlib/integrations/django_oauth2/authorization_server.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from authlib.oauth2 import AuthorizationServer as _AuthorizationServer | ||
| from authlib.oauth2.rfc6750 import BearerTokenGenerator | ||
|
|
||
| from .requests import DjangoJsonRequest, DjangoOAuth2Request | ||
|
|
||
| class AuthorizationServer(_AuthorizationServer): | ||
| client_model: Incomplete | ||
| token_model: Incomplete | ||
| def __init__(self, client_model, token_model) -> None: ... | ||
| config: Incomplete | ||
| scopes_supported: Incomplete | ||
| def load_config(self, config) -> None: ... | ||
| def query_client(self, client_id): ... | ||
| def save_token(self, token, request): ... | ||
| def create_oauth2_request(self, request) -> DjangoOAuth2Request: ... | ||
| def create_json_request(self, request) -> DjangoJsonRequest: ... | ||
| def handle_response(self, status_code, payload, headers): ... | ||
| def send_signal(self, name, *args, **kwargs) -> None: ... | ||
| def create_bearer_token_generator(self) -> BearerTokenGenerator: ... | ||
|
|
||
| def create_token_generator(token_generator_conf, length: int = 42): ... | ||
| def create_token_expires_in_generator(expires_in_conf=None): ... |
5 changes: 5 additions & 0 deletions
5
stubs/Authlib/authlib/integrations/django_oauth2/endpoints.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from authlib.oauth2.rfc7009 import RevocationEndpoint as _RevocationEndpoint | ||
|
|
||
| class RevocationEndpoint(_RevocationEndpoint): | ||
| def query_token(self, token, token_type_hint): ... | ||
| def revoke_token(self, token, request) -> None: ... |
20 changes: 20 additions & 0 deletions
20
stubs/Authlib/authlib/integrations/django_oauth2/requests.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from authlib.oauth2.rfc6749 import JsonPayload, JsonRequest, OAuth2Payload, OAuth2Request | ||
|
|
||
| class DjangoOAuth2Payload(OAuth2Payload): | ||
| def __init__(self, request) -> None: ... | ||
|
|
||
| class DjangoOAuth2Request(OAuth2Request): | ||
| payload: DjangoOAuth2Payload | ||
| def __init__(self, request) -> None: ... | ||
| @property | ||
| def args(self): ... | ||
| @property | ||
| def form(self): ... | ||
|
|
||
| class DjangoJsonPayload(JsonPayload): | ||
| def __init__(self, request) -> None: ... | ||
| def data(self): ... | ||
|
|
||
| class DjangoJsonRequest(JsonRequest): | ||
| payload: DjangoJsonPayload | ||
| def __init__(self, request) -> None: ... |
15 changes: 15 additions & 0 deletions
15
stubs/Authlib/authlib/integrations/django_oauth2/resource_protector.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from authlib.oauth2 import ResourceProtector as _ResourceProtector | ||
| from authlib.oauth2.rfc6750 import BearerTokenValidator as _BearerTokenValidator | ||
|
|
||
| class ResourceProtector(_ResourceProtector): | ||
| def acquire_token(self, request, scopes=None, **kwargs): ... | ||
| def __call__(self, scopes=None, optional=False, **kwargs): ... | ||
|
|
||
| class BearerTokenValidator(_BearerTokenValidator): | ||
| token_model: Incomplete | ||
| def __init__(self, token_model, realm=None, **extra_attributes): ... | ||
| def authenticate_token(self, token_string): ... | ||
|
|
||
| def return_error_response(error): ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| # actual types is django.dispatch.Signal | ||
| client_authenticated: Incomplete | ||
| token_revoked: Incomplete | ||
| token_authenticated: Incomplete |
20 changes: 20 additions & 0 deletions
20
stubs/Authlib/authlib/integrations/flask_client/__init__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from ..base_client import BaseOAuth, OAuthError as OAuthError | ||
| from .apps import FlaskOAuth1App as FlaskOAuth1App, FlaskOAuth2App as FlaskOAuth2App | ||
| from .integration import FlaskIntegration as FlaskIntegration, token_update as token_update | ||
|
|
||
| class OAuth(BaseOAuth): | ||
| oauth1_client_cls = FlaskOAuth1App | ||
| oauth2_client_cls = FlaskOAuth2App | ||
| framework_integration_cls = FlaskIntegration | ||
| app: Incomplete | ||
| def __init__(self, app=None, cache=None, fetch_token=None, update_token=None): ... | ||
| cache: Incomplete | ||
| fetch_token: Incomplete | ||
| update_token: Incomplete | ||
| def init_app(self, app, cache=None, fetch_token=None, update_token=None): ... | ||
| def create_client(self, name): ... | ||
| def register(self, name, overwrite=False, **kwargs): ... | ||
|
|
||
| __all__ = ["OAuth", "FlaskIntegration", "FlaskOAuth1App", "FlaskOAuth2App", "token_update", "OAuthError"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| from ..base_client import BaseApp, OAuth1Mixin, OAuth2Mixin, OpenIDMixin | ||
| from ..requests_client import OAuth1Session, OAuth2Session | ||
|
|
||
| class FlaskAppMixin: | ||
| @property | ||
| def token(self): ... | ||
| @token.setter | ||
| def token(self, token): ... | ||
| def save_authorize_data(self, **kwargs) -> None: ... | ||
| def authorize_redirect(self, redirect_uri=None, **kwargs): ... | ||
|
|
||
| class FlaskOAuth1App(FlaskAppMixin, OAuth1Mixin, BaseApp): | ||
| client_cls = OAuth1Session | ||
| def authorize_access_token(self, **kwargs): ... | ||
|
|
||
| class FlaskOAuth2App(FlaskAppMixin, OAuth2Mixin, OpenIDMixin, BaseApp): | ||
| client_cls = OAuth2Session | ||
| def authorize_access_token(self, **kwargs): ... |
10 changes: 10 additions & 0 deletions
10
stubs/Authlib/authlib/integrations/flask_client/integration.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from ..base_client import FrameworkIntegration | ||
|
|
||
| token_update: Incomplete | ||
|
|
||
| class FlaskIntegration(FrameworkIntegration): | ||
| def update_token(self, token, refresh_token=None, access_token=None) -> None: ... | ||
| @staticmethod | ||
| def load_config(oauth, name, params) -> dict[Incomplete, Incomplete]: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from .authorization_server import AuthorizationServer as AuthorizationServer | ||
| from .cache import ( | ||
| create_exists_nonce_func as create_exists_nonce_func, | ||
| register_nonce_hooks as register_nonce_hooks, | ||
| register_temporary_credential_hooks as register_temporary_credential_hooks, | ||
| ) | ||
| from .resource_protector import ResourceProtector as ResourceProtector, current_credential as current_credential |
29 changes: 29 additions & 0 deletions
29
stubs/Authlib/authlib/integrations/flask_oauth1/authorization_server.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import logging | ||
| from _typeshed import Incomplete | ||
| from collections.abc import Callable | ||
|
|
||
| from authlib.oauth1 import AuthorizationServer as _AuthorizationServer, OAuth1Request | ||
|
|
||
| log: logging.Logger | ||
|
|
||
| class AuthorizationServer(_AuthorizationServer): | ||
| app: Incomplete | ||
| query_client: Incomplete | ||
| token_generator: Incomplete | ||
| def __init__(self, app=None, query_client=None, token_generator=None): ... | ||
| SUPPORTED_SIGNATURE_METHODS: Incomplete | ||
| def init_app(self, app, query_client=None, token_generator=None): ... | ||
| def register_hook(self, name, func) -> None: ... | ||
| def create_token_generator(self, app) -> Callable[[], dict[str, str]]: ... | ||
| def get_client_by_id(self, client_id): ... | ||
| def exists_nonce(self, nonce, request): ... | ||
| def create_temporary_credential(self, request): ... | ||
| def get_temporary_credential(self, request): ... | ||
| def delete_temporary_credential(self, request): ... | ||
| def create_authorization_verifier(self, request): ... | ||
| def create_token_credential(self, request): ... | ||
| def check_authorization_request(self) -> OAuth1Request: ... | ||
| def create_authorization_response(self, request=None, grant_user=None): ... | ||
| def create_token_response(self, request=None): ... | ||
| def create_oauth1_request(self, request) -> OAuth1Request: ... | ||
| def handle_response(self, status_code, payload, headers): ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from _typeshed import Incomplete | ||
| from collections.abc import Callable | ||
|
|
||
| def register_temporary_credential_hooks(authorization_server, cache, key_prefix: str = "temporary_credential:") -> None: ... | ||
| def create_exists_nonce_func( | ||
| cache, key_prefix="nonce:", expires=86400 | ||
| ) -> Callable[[Incomplete, Incomplete, Incomplete, Incomplete], Incomplete]: ... | ||
| def register_nonce_hooks(authorization_server, cache, key_prefix: str = "nonce:", expires=86400) -> None: ... |
18 changes: 18 additions & 0 deletions
18
stubs/Authlib/authlib/integrations/flask_oauth1/resource_protector.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from authlib.oauth1 import ResourceProtector as _ResourceProtector | ||
|
|
||
| class ResourceProtector(_ResourceProtector): | ||
| app: Incomplete | ||
| query_client: Incomplete | ||
| query_token: Incomplete | ||
| def __init__(self, app=None, query_client=None, query_token=None, exists_nonce=None) -> None: ... | ||
| SUPPORTED_SIGNATURE_METHODS: Incomplete | ||
| def init_app(self, app, query_client=None, query_token=None, exists_nonce=None): ... | ||
| def get_client_by_id(self, client_id): ... | ||
| def get_token_credential(self, request): ... | ||
| def exists_nonce(self, nonce, request): ... | ||
| def acquire_credential(self): ... | ||
| def __call__(self, scope=None): ... | ||
|
|
||
| current_credential: Incomplete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from .authorization_server import AuthorizationServer as AuthorizationServer | ||
| from .resource_protector import ResourceProtector as ResourceProtector, current_token as current_token | ||
| from .signals import ( | ||
| client_authenticated as client_authenticated, | ||
| token_authenticated as token_authenticated, | ||
| token_revoked as token_revoked, | ||
| ) |
23 changes: 23 additions & 0 deletions
23
stubs/Authlib/authlib/integrations/flask_oauth2/authorization_server.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| from authlib.oauth2 import AuthorizationServer as _AuthorizationServer | ||
| from authlib.oauth2.rfc6750 import BearerTokenGenerator | ||
|
|
||
| from .requests import FlaskJsonRequest, FlaskOAuth2Request | ||
|
|
||
| class AuthorizationServer(_AuthorizationServer): | ||
| def __init__(self, app=None, query_client=None, save_token=None) -> None: ... | ||
| def init_app(self, app, query_client=None, save_token=None) -> None: ... | ||
| scopes_supported: Incomplete | ||
| def load_config(self, config) -> None: ... | ||
| def query_client(self, client_id): ... | ||
| def save_token(self, token, request): ... | ||
| def get_error_uri(self, request, error): ... | ||
| def create_oauth2_request(self, request) -> FlaskOAuth2Request: ... | ||
| def create_json_request(self, request) -> FlaskJsonRequest: ... | ||
| def handle_response(self, status_code, payload, headers): ... | ||
| def send_signal(self, name, *args, **kwargs) -> None: ... | ||
| def create_bearer_token_generator(self, config) -> BearerTokenGenerator: ... | ||
|
|
||
| def create_token_expires_in_generator(expires_in_conf=None): ... | ||
| def create_token_generator(token_generator_conf, length: int = 42): ... |
14 changes: 14 additions & 0 deletions
14
stubs/Authlib/authlib/integrations/flask_oauth2/errors.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from _typeshed import Incomplete | ||
| from typing import NoReturn | ||
|
|
||
| # Inherits from werkzeug.exceptions.HTTPException | ||
| class _HTTPException: | ||
| code: Incomplete | ||
| body: Incomplete | ||
| headers: Incomplete | ||
| def __init__(self, code, body, headers, response=None) -> None: ... | ||
| # Params depends on `werkzeug` package version | ||
| def get_body(self, environ=None, scope=None): ... | ||
| def get_headers(self, environ=None, scope=None): ... | ||
|
|
||
| def raise_http_exception(status, body, headers) -> NoReturn: ... |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.