make_jwt_config
make_jwt_config
¶
make_jwt_config(alg: Literal['HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512'] = 'HS256', secret_key: str | None = None, public_key: str | None = None, private_key: str | None = None, expire: int = 3600, list: JWTList | None = None) -> dict[str, Any]
Util for making JWT config.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
alg
|
Literal['HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512', 'PS512', 'PS384', 'PS512']
|
Algorithm for token encryption |
'HS256'
|
secret_key
|
str | None
|
Secret key for HMAC enecryption |
None
|
private_key
|
str | None
|
Private key for RSA enecryption |
None
|
public_key
|
str | None
|
Public key for RSA |
None
|
expire
|
int
|
Token lifetime in seconds |
3600
|
list
|
JWTList | None
|
List module for checking |
None
|
Raises:
Type | Description |
---|---|
EmptySecretKey
|
If HS* algorithm is selected, but the secret key is empty |
EmtpyPrivateKey
|
If RS* algorithm is selected, but the private key is empty |
EmtpyPublicKey
|
If RS* algorithm is selected, but the public key is empty |