-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[Authlib] Update to 1.7.1 #15741
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
Open
donbarbos
wants to merge
1
commit into
python:main
Choose a base branch
from
donbarbos:bump-Authlib-1.7.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Authlib] Update to 1.7.1 #15741
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| version = "1.6.11" | ||
| version = "1.7.1" | ||
| upstream-repository = "https://github.com/authlib/authlib" | ||
| dependencies = ["cryptography"] |
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,5 +1,3 @@ | ||
| class AuthlibDeprecationWarning(DeprecationWarning): ... | ||
|
|
||
| def deprecate( | ||
| message: str, version: str | None = None, link_uid: str | None = None, link_file: str | None = None, stacklevel: int = 3 | ||
| ) -> None: ... | ||
| def deprecate(message: str, version: str | None = None, stacklevel: int = 3) -> None: ... |
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
12 changes: 11 additions & 1 deletion
12
stubs/Authlib/authlib/integrations/base_client/sync_openid.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 |
|---|---|---|
| @@ -1,7 +1,17 @@ | ||
| from _typeshed import Incomplete | ||
| from typing import TypedDict, type_check_only | ||
|
|
||
| from authlib.oidc.core.claims import UserInfo | ||
|
|
||
| @type_check_only | ||
| class _LogoutData(TypedDict): | ||
| url: str | ||
| state: Incomplete | ||
|
|
||
| class OpenIDMixin: | ||
| def fetch_jwk_set(self, force: bool = False): ... | ||
| def userinfo(self, **kwargs) -> UserInfo: ... | ||
| def parse_id_token(self, token, nonce, claims_options=None, claims_cls=None, leeway: int = 120) -> UserInfo | None: ... | ||
| def create_load_key(self): ... | ||
| def create_logout_url( | ||
| self, post_logout_redirect_uri=None, id_token_hint=None, state=None, *, client_id=None, logout_hint=None, ui_locales=None | ||
| ) -> _LogoutData: ... |
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
19 changes: 18 additions & 1 deletion
19
stubs/Authlib/authlib/integrations/starlette_client/apps.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 |
|---|---|---|
| @@ -1,16 +1,33 @@ | ||
| from _typeshed import Incomplete | ||
| from typing import TypeAlias | ||
|
|
||
| from ..base_client import BaseApp | ||
| from ..base_client.async_app import AsyncOAuth1Mixin, AsyncOAuth2Mixin | ||
| from ..base_client.async_openid import AsyncOpenIDMixin | ||
| from ..httpx_client import AsyncOAuth1Client, AsyncOAuth2Client | ||
|
|
||
| _RedirectResponse: TypeAlias = Incomplete # actual type is starlette.responses.RedirectResponse | ||
|
|
||
| class StarletteAppMixin: | ||
| async def save_authorize_data(self, request, **kwargs) -> None: ... | ||
| async def authorize_redirect(self, request, redirect_uri=None, **kwargs): ... | ||
| async def authorize_redirect(self, request, redirect_uri=None, **kwargs) -> _RedirectResponse: ... | ||
|
|
||
| class StarletteOAuth1App(StarletteAppMixin, AsyncOAuth1Mixin, BaseApp): | ||
| client_cls = AsyncOAuth1Client | ||
| async def authorize_access_token(self, request, **kwargs): ... | ||
|
|
||
| class StarletteOAuth2App(StarletteAppMixin, AsyncOAuth2Mixin, AsyncOpenIDMixin, BaseApp): | ||
| client_cls = AsyncOAuth2Client | ||
| async def logout_redirect( | ||
| self, | ||
| request, | ||
| post_logout_redirect_uri=None, | ||
| id_token_hint=None, | ||
| *, | ||
| state=None, | ||
| client_id=None, | ||
| logout_hint=None, | ||
| ui_locales=None, | ||
| ) -> _RedirectResponse: ... | ||
| async def validate_logout_response(self, request): ... | ||
| async def authorize_access_token(self, request, **kwargs): ... |
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 |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| from _typeshed import Incomplete | ||
| from collections.abc import Callable | ||
| from typing import Any, TypedDict | ||
|
|
||
| class ClaimsOption(TypedDict, total=False): | ||
| essential: bool | ||
| allow_blank: bool | None | ||
| value: str | int | bool | ||
| values: list[str | int | bool] | list[str] | list[int] | list[bool] | ||
| validate: Callable[[BaseClaims, Any], bool] | ||
|
|
||
| class BaseClaims(dict[str, Incomplete]): | ||
| registry_cls: Incomplete | ||
| REGISTERED_CLAIMS: list[str] | ||
| header: dict[str, Any] | ||
| options: dict[str, ClaimsOption] | ||
| params: dict[str, Any] | ||
| def __init__( | ||
| self, | ||
| claims: dict[str, Any], | ||
| header: dict[str, Any], | ||
| options: dict[str, ClaimsOption] | None = None, | ||
| params: dict[str, Any] | None = None, | ||
| ) -> None: ... | ||
| def get_registered_claims(self) -> dict[str, Incomplete]: ... | ||
| def validate(self, now: int | Callable[[], int] | None = None, leeway: int = 0) -> None: ... | ||
|
|
||
| class JWTClaims(BaseClaims): | ||
| registry_cls: Incomplete | ||
| REGISTERED_CLAIMS: list[str] | ||
| def validate(self, now: int | Callable[[], int] | None = None, leeway: int = 0) -> None: ... |
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
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 dataclasses import dataclass | ||
| from typing import Any | ||
|
|
||
| from .requests import OAuth2Request | ||
|
|
||
| @dataclass | ||
| class EndpointRequest: | ||
| request: OAuth2Request | ||
| client: Any = None | ||
|
|
||
| class Endpoint: | ||
| ENDPOINT_NAME: str | None | ||
| server: Incomplete | ||
| def __init__(self, server=None) -> None: ... | ||
| def create_endpoint_request(self, request): ... | ||
| def validate_request(self, request: OAuth2Request) -> EndpointRequest: ... | ||
| def create_response(self, validated_request: EndpointRequest) -> tuple[int, Any, list[Incomplete]] | None: ... | ||
| def create_endpoint_response(self, request: OAuth2Request) -> tuple[int, Any, list[Incomplete]] | None: ... | ||
| def __call__(self, request: OAuth2Request) -> tuple[int, Any, list[Incomplete]] | None: ... | ||
|
Comment on lines
+18
to
+20
Collaborator
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. Same here. |
||
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,13 +1,11 @@ | ||
| from _typeshed import Incomplete | ||
|
|
||
| class TokenEndpoint: | ||
| ENDPOINT_NAME: Incomplete | ||
| from .endpoint import Endpoint | ||
|
|
||
| class TokenEndpoint(Endpoint): | ||
| ENDPOINT_NAME: str | None | ||
| SUPPORTED_TOKEN_TYPES: Incomplete | ||
| CLIENT_AUTH_METHODS: Incomplete | ||
| server: Incomplete | ||
| def __init__(self, server) -> None: ... | ||
| def __call__(self, request): ... | ||
| def create_endpoint_request(self, request): ... | ||
| def authenticate_endpoint_client(self, request): ... | ||
| def authenticate_token(self, request, client): ... | ||
| def create_endpoint_response(self, request): ... |
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,5 +1,27 @@ | ||
| def sign_jwt_bearer_assertion( | ||
| key, issuer, audience, subject=None, issued_at=None, expires_at=None, claims=None, header=None, **kwargs | ||
| ) -> bytes: ... | ||
| def client_secret_jwt_sign(client_secret, client_id, token_endpoint, alg: str = "HS256", claims=None, **kwargs) -> bytes: ... | ||
| def private_key_jwt_sign(private_key, client_id, token_endpoint, alg: str = "RS256", claims=None, **kwargs) -> bytes: ... | ||
| key, issuer, audience, subject=None, issued_at=None, expires_at=None, claims=None, header=None, *, alg=None, expires_in=3600 | ||
| ) -> str: ... | ||
| def client_secret_jwt_sign( | ||
| client_secret, | ||
| client_id, | ||
| token_endpoint, | ||
| alg: str = "HS256", | ||
| claims=None, | ||
| *, | ||
| issued_at=None, | ||
| expires_at=None, | ||
| header=None, | ||
| expires_in=3600, | ||
| ) -> str: ... | ||
| def private_key_jwt_sign( | ||
| private_key, | ||
| client_id, | ||
| token_endpoint, | ||
| alg: str = "RS256", | ||
| claims=None, | ||
| *, | ||
| issued_at=None, | ||
| expires_at=None, | ||
| header=None, | ||
| expires_in=3600, | ||
| ) -> 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
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,21 +1,26 @@ | ||
| from _typeshed import Incomplete | ||
| from logging import Logger | ||
| from typing import Final | ||
|
|
||
| from authlib.jose.rfc7519.claims import JWTClaims | ||
| from typing import Final, overload | ||
| from typing_extensions import deprecated | ||
|
|
||
| ASSERTION_TYPE: Final[str] | ||
| log: Logger | ||
|
|
||
| class JWTBearerClientAssertion: | ||
| CLIENT_ASSERTION_TYPE: Final[str] | ||
| CLIENT_AUTH_METHOD: Final[str] | ||
| token_url: str | ||
| token_url: str | None | ||
| leeway: int | ||
| def __init__(self, token_url: str, validate_jti: bool = True, leeway: int = 60) -> None: ... | ||
| @overload | ||
| @deprecated("The `token_url` parameter is deprecated. Override `get_audiences` instead.") | ||
| def __init__(self, token_url: str = ..., validate_jti: bool = True, leeway: int = 60) -> None: ... | ||
| @overload | ||
| def __init__(self, token_url: None = None, validate_jti: bool = True, leeway: int = 60) -> None: ... | ||
| def __call__(self, query_client, request): ... | ||
| def create_claims_options(self): ... | ||
| def process_assertion_claims(self, assertion, resolve_key) -> JWTClaims: ... | ||
| def verify_claims(self, claims: dict[str, Incomplete]) -> None: ... | ||
| def get_audiences(self) -> list[str]: ... | ||
| def process_assertion_claims(self, assertion, resolve_key) -> dict[str, Incomplete]: ... | ||
| def authenticate_client(self, client): ... | ||
| def create_resolve_key_func(self, query_client, request): ... | ||
| def extract_assertion(self, assertion: str) -> tuple[dict[str, Incomplete], Incomplete]: ... | ||
| def validate_jti(self, claims, jti): ... | ||
| def resolve_client_public_key(self, client, headers): ... | ||
| def resolve_client_public_key(self, client): ... |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining the
Any. Also, we can useAny | Noneto slight tighten it.