File: jwt.pyi

package info (click to toggle)
typeshed 0.0~git20221107.4f381af-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,036 kB
  • sloc: python: 3,216; sh: 62; makefile: 13
file content (26 lines) | stat: -rw-r--r-- 968 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from collections.abc import Container, Iterable, Mapping, MutableMapping
from typing import Any

from .backends.base import Key

def encode(
    claims: MutableMapping[str, Any],
    # Internally it calls jws.sign() that expects a key dict instance instead of Mapping
    key: str | bytes | dict[str, Any] | Key,
    algorithm: str = ...,
    headers: Mapping[str, Any] | None = ...,
    access_token: str | None = ...,
) -> str: ...
def decode(
    token: str | bytes,
    key: str | bytes | Mapping[str, Any] | Key,
    algorithms: str | Container[str] | None = ...,
    options: Mapping[str, Any] | None = ...,
    audience: str | None = ...,
    issuer: str | Iterable[str] | None = ...,
    subject: str | None = ...,
    access_token: str | None = ...,
) -> dict[str, Any]: ...
def get_unverified_header(token: str) -> dict[str, Any]: ...
def get_unverified_headers(token: str) -> dict[str, Any]: ...
def get_unverified_claims(token: str) -> dict[str, Any]: ...