2022-09-16 21:50:55 +02:00
|
|
|
from datetime import timedelta
|
|
|
|
from redis import Redis
|
|
|
|
from pydantic import BaseModel
|
2022-09-18 22:43:04 +02:00
|
|
|
|
2022-09-16 21:50:55 +02:00
|
|
|
SECRET_KEY = "6323081020d8939e6385dd688a26cbca0bb34ed91997959167637319ba4f6f3e"
|
|
|
|
ALGORITHM = "HS256"
|
|
|
|
ACCESS_TOKEN_EXPIRE_MINUTES = 30
|
|
|
|
|
|
|
|
|
|
|
|
redis_conn = Redis(host='localhost', port=6379, db=0, decode_responses=True)
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseModel):
|
|
|
|
authjwt_secret_key: str = SECRET_KEY
|
|
|
|
authjwt_denylist_enabled: bool = False
|
|
|
|
authjwt_denylist_token_checks: set = {"access", "refresh"}
|
|
|
|
access_expires: int = timedelta(minutes=15)
|
|
|
|
refresh_expires: int = timedelta(days=30)
|
|
|
|
|
|
|
|
|
|
|
|
settings = Settings()
|