Skip to content

Commit 2408c02

Browse files
authored
[Authlib] Update to 1.5.2 (#13840)
1 parent dbd3ad3 commit 2408c02

File tree

6 files changed

+52
-9
lines changed

6 files changed

+52
-9
lines changed

stubs/Authlib/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "1.5.0"
1+
version = "~= 1.5.2"
22
upstream_repository = "https://github.com/lepture/authlib"
33
requires = ["cryptography"]
44
partial_stub = true

stubs/Authlib/authlib/common/urls.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def quote(s: str, safe: bytes = b"/") -> str: ...
1616
def unquote(s: str) -> str: ...
1717
def quote_url(s: str) -> str: ...
1818
def extract_params(raw: dict[str, str] | _ExplodedQueryString) -> _ExplodedQueryString: ...
19-
def is_valid_url(url: str) -> bool: ...
19+
def is_valid_url(url: str, fragments_allowed: bool = True) -> bool: ...

stubs/Authlib/authlib/integrations/base_client/async_openid.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ __all__ = ["AsyncOpenIDMixin"]
33
class AsyncOpenIDMixin:
44
async def fetch_jwk_set(self, force: bool = False): ...
55
async def userinfo(self, **kwargs): ...
6-
async def parse_id_token(self, token, nonce, claims_options=None): ...
6+
async def parse_id_token(self, token, nonce, claims_options=None, claims_cls=None, leeway: int = 120): ...
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class OpenIDMixin:
22
def fetch_jwk_set(self, force: bool = False): ...
33
def userinfo(self, **kwargs): ...
4-
def parse_id_token(self, token, nonce, claims_options=None, leeway: int = 120): ...
4+
def parse_id_token(self, token, nonce, claims_options=None, claims_cls=None, leeway: int = 120): ...
55
def create_load_key(self): ...
Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
11
from _typeshed import Incomplete
2+
from collections.abc import Callable
3+
from re import Pattern
4+
from typing import Any, Final, Generic, TypedDict, TypeVar, overload, type_check_only
5+
from typing_extensions import TypeAlias
6+
7+
from ..rfc7517 import KeySet
8+
from .claims import JWTClaims
9+
10+
_T = TypeVar("_T")
11+
12+
_LoadKey: TypeAlias = Callable[[Incomplete, Incomplete], Incomplete]
213

314
class JsonWebToken:
4-
SENSITIVE_NAMES: Incomplete
5-
SENSITIVE_VALUES: Incomplete
15+
SENSITIVE_NAMES: Final[tuple[str, ...]]
16+
SENSITIVE_VALUES: Final[Pattern[str]]
17+
618
def __init__(self, algorithms, private_headers=None) -> None: ...
719
def check_sensitive_data(self, payload) -> None: ...
820
def encode(self, header, payload, key, check: bool = True): ...
9-
def decode(self, s, key, claims_cls=None, claims_options=None, claims_params=None): ...
21+
@overload
22+
def decode(
23+
self,
24+
s: str | bytes,
25+
key: _LoadKey | KeySet | tuple[Incomplete, ...] | list[Incomplete] | str,
26+
claims_cls: None = None,
27+
claims_options=None,
28+
claims_params=None,
29+
) -> JWTClaims: ...
30+
@overload
31+
def decode(
32+
self,
33+
s: str | bytes,
34+
key: _LoadKey | KeySet | tuple[Incomplete, ...] | list[Incomplete] | str,
35+
claims_cls: type[_T],
36+
claims_options=None,
37+
claims_params=None,
38+
) -> _T: ...
1039

1140
def decode_payload(bytes_payload): ...
12-
def prepare_raw_key(raw): ...
41+
42+
_TL = TypeVar("_TL", bound=tuple[Any, ...] | list[Any])
43+
44+
@type_check_only
45+
class _Keys(TypedDict, Generic[_TL]):
46+
keys: _TL
47+
48+
@overload
49+
def prepare_raw_key(raw: KeySet) -> KeySet: ...
50+
@overload
51+
def prepare_raw_key(raw: str) -> dict[str, Any] | str: ... # dict is a JSON object
52+
@overload
53+
def prepare_raw_key(raw: _TL) -> _Keys[_TL]: ...
1354
def find_encode_key(key, header): ...
14-
def create_load_key(key): ...
55+
def create_load_key(key: KeySet | _Keys[Incomplete] | Incomplete) -> _LoadKey: ...

stubs/Authlib/authlib/oauth2/base.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ from _typeshed import Incomplete
22

33
from authlib.common.errors import AuthlibHTTPError
44

5+
def invalid_error_characters(text: str) -> list[str]: ...
6+
57
class OAuth2Error(AuthlibHTTPError):
68
state: Incomplete
79
redirect_uri: Incomplete

0 commit comments

Comments
 (0)