Skip to content

[Authlib] Update to 1.5.2 #13840

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stubs/Authlib/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.5.0"
version = "~= 1.5.2"
upstream_repository = "https://github.com./lepture/authlib"
requires = ["cryptography"]
partial_stub = true
Expand Down
2 changes: 1 addition & 1 deletion stubs/Authlib/authlib/common/urls.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def quote(s: str, safe: bytes = b"/") -> str: ...
def unquote(s: str) -> str: ...
def quote_url(s: str) -> str: ...
def extract_params(raw: dict[str, str] | _ExplodedQueryString) -> _ExplodedQueryString: ...
def is_valid_url(url: str) -> bool: ...
def is_valid_url(url: str, fragments_allowed: bool = True) -> bool: ...
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ __all__ = ["AsyncOpenIDMixin"]
class AsyncOpenIDMixin:
async def fetch_jwk_set(self, force: bool = False): ...
async def userinfo(self, **kwargs): ...
async def parse_id_token(self, token, nonce, claims_options: Incomplete | None = None): ...
async def parse_id_token(
self, token, nonce, claims_options: Incomplete | None = None, claims_cls: Incomplete | None = None, leeway: int = 120
): ...
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ from _typeshed import Incomplete
class OpenIDMixin:
def fetch_jwk_set(self, force: bool = False): ...
def userinfo(self, **kwargs): ...
def parse_id_token(self, token, nonce, claims_options: Incomplete | None = None, leeway: int = 120): ...
def parse_id_token(
self, token, nonce, claims_options: Incomplete | None = None, claims_cls: Incomplete | None = None, leeway: int = 120
): ...
def create_load_key(self): ...
50 changes: 42 additions & 8 deletions stubs/Authlib/authlib/jose/rfc7519/jwt.pyi
Original file line number Diff line number Diff line change
@@ -1,21 +1,55 @@
from _typeshed import Incomplete
from collections.abc import Callable
from re import Pattern
from typing import Any, Final, Generic, TypedDict, TypeVar, overload, type_check_only
from typing_extensions import TypeAlias

from ..rfc7517 import KeySet
from .claims import JWTClaims

_T = TypeVar("_T")

_LoadKey: TypeAlias = Callable[[Incomplete, Incomplete], Incomplete]

class JsonWebToken:
SENSITIVE_NAMES: Incomplete
SENSITIVE_VALUES: Incomplete
SENSITIVE_NAMES: Final[tuple[str, ...]]
SENSITIVE_VALUES: Final[Pattern[str]]

def __init__(self, algorithms, private_headers: Incomplete | None = None) -> None: ...
def check_sensitive_data(self, payload) -> None: ...
def encode(self, header, payload, key, check: bool = True): ...
@overload
def decode(
self,
s,
key,
claims_cls: Incomplete | None = None,
s: str | bytes,
key: _LoadKey | KeySet | tuple[Incomplete, ...] | list[Incomplete] | str,
claims_cls: None = None,
claims_options: Incomplete | None = None,
claims_params: Incomplete | None = None,
): ...
) -> JWTClaims: ...
@overload
def decode(
self,
s: str | bytes,
key: _LoadKey | KeySet | tuple[Incomplete, ...] | list[Incomplete] | str,
claims_cls: type[_T],
claims_options: Incomplete | None = None,
claims_params: Incomplete | None = None,
) -> _T: ...

def decode_payload(bytes_payload): ...
def prepare_raw_key(raw): ...

_TL = TypeVar("_TL", bound=tuple[Any, ...] | list[Any])

@type_check_only
class _Keys(TypedDict, Generic[_TL]):
keys: _TL

@overload
def prepare_raw_key(raw: KeySet) -> KeySet: ...
@overload
def prepare_raw_key(raw: str) -> dict[str, Any] | str: ... # dict is a JSON object
@overload
def prepare_raw_key(raw: _TL) -> _Keys[_TL]: ...
def find_encode_key(key, header): ...
def create_load_key(key): ...
def create_load_key(key: KeySet | _Keys[Incomplete] | Incomplete) -> _LoadKey: ...
2 changes: 2 additions & 0 deletions stubs/Authlib/authlib/oauth2/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ from _typeshed import Incomplete

from authlib.common.errors import AuthlibHTTPError

def invalid_error_characters(text: str) -> list[str]: ...

class OAuth2Error(AuthlibHTTPError):
state: Incomplete
redirect_uri: Incomplete
Expand Down