Skip to content

Commit 38f334e

Browse files
authored
[Authlib] Fix JsonWebKey.import_key typing (#15766)
1 parent 4e1948a commit 38f334e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • stubs/Authlib/authlib/jose/rfc7517
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from _typeshed import Incomplete
2-
from collections.abc import Collection, Mapping
1+
from _typeshed import Incomplete, ReadableBuffer
2+
from collections.abc import Collection, Iterable, Mapping
3+
from typing import SupportsBytes, SupportsIndex
34

45
from authlib.jose.rfc7517 import Key, KeySet
56

@@ -8,6 +9,12 @@ class JsonWebKey:
89
@classmethod
910
def generate_key(cls, kty, crv_or_size, options=None, is_private: bool = False): ...
1011
@classmethod
11-
def import_key(cls, raw: Mapping[str, object], options: Mapping[str, object] | None = None) -> Key: ...
12+
def import_key(
13+
cls,
14+
raw: (
15+
str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | Mapping[str, object]
16+
),
17+
options: Mapping[str, object] | None = None,
18+
) -> Key: ...
1219
@classmethod
1320
def import_key_set(cls, raw: str | Collection[str] | dict[str, object]) -> KeySet: ...

0 commit comments

Comments
 (0)