Skip to content

Commit 72ff7b9

Browse files
utkarsh2102srittau
authored andcommitted
__init__.pyi: Accept RSAPrivateKey or RSAPublicKey as the key (#3410)
Closes: #3381
1 parent 1241115 commit 72ff7b9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

third_party/3/jwt/__init__.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from typing import Mapping, Any, Optional, Union, Dict
22

33
from . import algorithms
4+
from cryptography.hazmat.primitives.asymmetric import rsa
45

5-
def decode(jwt: Union[str, bytes], key: Union[str, bytes] = ...,
6+
7+
def decode(jwt: Union[str, bytes], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey] = ...,
68
verify: bool = ..., algorithms: Optional[Any] = ...,
79
options: Optional[Mapping[Any, Any]] = ...,
810
**kwargs: Any) -> Dict[str, Any]: ...
911

10-
def encode(payload: Mapping[str, Any], key: Union[str, bytes],
12+
def encode(payload: Mapping[str, Any], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey],
1113
algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ...,
1214
json_encoder: Optional[Any] = ...) -> bytes: ...
1315

0 commit comments

Comments
 (0)