jam.aio.jwt.lists.redis
redis
¶
Classes:
Name | Description |
---|---|
RedisList |
Black/White lists in Redis, most optimal format. |
RedisList
¶
RedisList(
type: Literal["white", "black"],
redis_uri: Union[str, Redis],
in_list_life_time: Optional[int] = None,
)
Bases: BaseJWTList
Black/White lists in Redis, most optimal format.
Dependency required: pip install jamlib[redis]
Attributes:
Name | Type | Description |
---|---|---|
__list__ |
Redis
|
Redis instance |
exp |
int | None
|
Token lifetime |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
Literal['white', 'black']
|
Type of list |
required |
redis_uri
|
str
|
Uri to redis connect |
required |
in_list_life_time
|
int | None
|
The lifetime of a token in the list |
None
|
Methods:
Name | Description |
---|---|
add |
Method for adding token to list. |
check |
Method for checking if a token is present in the list. |
delete |
Method for removing a token from a list. |
add
async
¶
add(token: str) -> None
Method for adding token to list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str
|
Your JWT token |
required |
Returns:
Type | Description |
---|---|
None
|
(None) |
check
async
¶
check(token: str) -> bool
Method for checking if a token is present in the list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str
|
Your JWT token |
required |
Returns:
Type | Description |
---|---|
bool
|
(bool) |
delete
async
¶
delete(token: str) -> None
Method for removing a token from a list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str
|
Your JWT token |
required |
Returns:
Type | Description |
---|---|
None
|
None |
FILE PATH: jam/aio/jwt/lists/redis.py