|
| 1 | +from _typeshed import Incomplete |
| 2 | +from collections.abc import Callable |
| 3 | +from typing import TypedDict |
| 4 | + |
| 5 | +class ClaimsOption(TypedDict, total=False): |
| 6 | + essential: bool |
| 7 | + allow_blank: bool | None |
| 8 | + value: str | int | bool |
| 9 | + values: list[str | int | bool] | list[str] | list[int] | list[bool] |
| 10 | + validate: Callable[[BaseClaims, Incomplete], bool] |
| 11 | + |
| 12 | +class BaseClaims(dict[str, Incomplete]): |
| 13 | + registry_cls: Incomplete |
| 14 | + REGISTERED_CLAIMS: list[str] |
| 15 | + header: dict[str, Incomplete] |
| 16 | + options: dict[str, ClaimsOption] |
| 17 | + params: dict[str, Incomplete] |
| 18 | + def __init__( |
| 19 | + self, |
| 20 | + claims: dict[str, Incomplete], |
| 21 | + header: dict[str, Incomplete], |
| 22 | + options: dict[str, ClaimsOption] | None = None, |
| 23 | + params: dict[str, Incomplete] | None = None, |
| 24 | + ) -> None: ... |
| 25 | + def get_registered_claims(self) -> dict[str, Incomplete]: ... |
| 26 | + def validate(self, now: int | Callable[[], int] | None = None, leeway: int = 0) -> None: ... |
| 27 | + |
| 28 | +class JWTClaims(BaseClaims): |
| 29 | + registry_cls: Incomplete |
| 30 | + REGISTERED_CLAIMS: list[str] |
| 31 | + def validate(self, now: int | Callable[[], int] | None = None, leeway: int = 0) -> None: ... |
0 commit comments