mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
__init__.pyi: Accept RSAPrivateKey or RSAPublicKey as the key (#3410)
Closes: #3381
This commit is contained in:
committed by
Sebastian Rittau
parent
124111534a
commit
72ff7b94e5
6
third_party/3/jwt/__init__.pyi
vendored
6
third_party/3/jwt/__init__.pyi
vendored
@@ -1,13 +1,15 @@
|
||||
from typing import Mapping, Any, Optional, Union, Dict
|
||||
|
||||
from . import algorithms
|
||||
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||
|
||||
def decode(jwt: Union[str, bytes], key: Union[str, bytes] = ...,
|
||||
|
||||
def decode(jwt: Union[str, bytes], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey] = ...,
|
||||
verify: bool = ..., algorithms: Optional[Any] = ...,
|
||||
options: Optional[Mapping[Any, Any]] = ...,
|
||||
**kwargs: Any) -> Dict[str, Any]: ...
|
||||
|
||||
def encode(payload: Mapping[str, Any], key: Union[str, bytes],
|
||||
def encode(payload: Mapping[str, Any], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey],
|
||||
algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ...,
|
||||
json_encoder: Optional[Any] = ...) -> bytes: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user