massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / third_party / 3 / jwt / __init__.pyi
1 from typing import Mapping, Any, Optional, Union\r
2 \r
3 from . import algorithms\r
4 \r
5 def decode(jwt: Union[str, bytes], key: Union[str, bytes] = ...,\r
6            verify: bool = ..., algorithms: Optional[Any] = ...,\r
7            options: Optional[Mapping[Any, Any]] = ...,\r
8            **kwargs: Any) -> Mapping[str, Any]: ...\r
9 \r
10 def encode(payload: Mapping[str, Any], key: Union[str, bytes],\r
11            algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ...,\r
12            json_encoder: Optional[Any] = ...) -> bytes: ...\r
13 \r
14 def register_algorithm(alg_id: str,\r
15                        alg_obj: algorithms.Algorithm) -> None: ...\r
16 \r
17 def unregister_algorithm(alg_id: str) -> None: ...\r
18 \r
19 class InvalidTokenError(Exception): ...\r
20 class DecodeError(InvalidTokenError): ...\r
21 class ExpiredSignatureError(InvalidTokenError): ...\r
22 class InvalidAudienceError(InvalidTokenError): ...\r
23 class InvalidIssuerError(InvalidTokenError): ...\r
24 class InvalidIssuedAtError(InvalidTokenError): ...\r
25 class ImmatureSignatureError(InvalidTokenError): ...\r
26 class InvalidKeyError(Exception): ...\r
27 class InvalidAlgorithmError(InvalidTokenError): ...\r
28 class MissingRequiredClaimError(InvalidTokenError): ...\r
29 \r
30 # Compatibility aliases (deprecated)\r
31 ExpiredSignature = ExpiredSignatureError\r
32 InvalidAudience = InvalidAudienceError\r
33 InvalidIssuer = InvalidIssuerError\r
34 \r
35 # These aren't actually documented, but the package\r
36 # exports them in __init__.py, so we should at least\r
37 # make sure that mypy doesn't raise spurious errors\r
38 # if they're used.\r
39 get_unverified_header = ...  # type: Any\r
40 PyJWT = ...  # type: Any\r
41 PyJWS = ...  # type: Any\r