jam.paseto.v1¶
v1
¶
Classes:
| Name | Description |
|---|---|
PASETOv1 |
Paseto v1 factory. |
PASETOv1
¶
PASETOv1()
Bases: BasePASETO
Paseto v1 factory.
Methods:
| Name | Description |
|---|---|
decode |
Decode PASETO. |
encode |
Encode PASETO. |
key |
Return PASETO instance. |
decode
¶
decode(
token: str,
serializer: type[BaseEncoder]
| BaseEncoder = JsonEncoder,
) -> tuple[dict[str, Any], dict[str, Any] | None]
Decode PASETO.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
PASETO |
required |
serializer
|
BaseEncoder
|
Json serializer |
JsonEncoder
|
encode
¶
encode(
payload: dict[str, Any],
footer: dict[str, Any] | str | None = None,
serializer: type[BaseEncoder]
| BaseEncoder = JsonEncoder,
) -> str
Encode PASETO.
key
classmethod
¶
key(
purpose: Literal["local", "public"],
secret_key: str
| bytes
| None
| RSAPrivateKey
| RSAPublicKey,
) -> PASETO
Return PASETO instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
purpose
|
Literal['local', 'public']
|
Paseto purpose |
required |
secret_key
|
str | bytes
|
PEM or secret key |
required |
Raises:
| Type | Description |
|---|---|
JamPASETOInvalidRSAKey
|
If the key is invalid. |
Returns:
| Name | Type | Description |
|---|---|---|
PASETO |
PASETO
|
Paseto instance |