From 3755d5948d268380e26ae70c3eabee36507b7d93 Mon Sep 17 00:00:00 2001 From: Lazyuki Date: Mon, 11 May 2026 16:17:41 +0100 Subject: [PATCH 1/2] Update jwk.pyi import_key's raw accepts everything that load_pem_key accepts. --- stubs/Authlib/authlib/jose/rfc7517/jwk.pyi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi index efbcc909b08e..adfffdab6475 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi @@ -1,5 +1,6 @@ -from _typeshed import Incomplete -from collections.abc import Collection, Mapping +from _typeshed import Incomplete, ReadableBuffer +from collections.abc import Collection, Iterable, Mapping +from typing import SupportsBytes, SupportsIndex from authlib.jose.rfc7517 import Key, KeySet @@ -8,6 +9,10 @@ class JsonWebKey: @classmethod def generate_key(cls, kty, crv_or_size, options=None, is_private: bool = False): ... @classmethod - def import_key(cls, raw: Mapping[str, object], options: Mapping[str, object] | None = None) -> Key: ... + def import_key( + cls, + raw: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | Mapping[str, object], + options: Mapping[str, object] | None = None + ) -> Key: ... @classmethod def import_key_set(cls, raw: str | Collection[str] | dict[str, object]) -> KeySet: ... From cae9d02b256cc34d69918f28d257c7716d47f1fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 15:25:21 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/Authlib/authlib/jose/rfc7517/jwk.pyi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi index adfffdab6475..97ca89d0c872 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi @@ -11,8 +11,10 @@ class JsonWebKey: @classmethod def import_key( cls, - raw: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | Mapping[str, object], - options: Mapping[str, object] | None = None + raw: ( + str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | Mapping[str, object] + ), + options: Mapping[str, object] | None = None, ) -> Key: ... @classmethod def import_key_set(cls, raw: str | Collection[str] | dict[str, object]) -> KeySet: ...