feat: добавлены необходимые зависимости и конфигурации
- Добавлена зависимость pyjwt для работы с JWT-токенами. - Обновлен файл .pre-commit-config.yaml, добавлен хук mypy для проверки типов. - Внесены изменения в .env.example для поддержки нового параметра ACCESS_TOKEN_EXPIRE. - Добавлен новый атрибут access_token_expire в класс Settings в lkeep/core/settings.py.
This commit is contained in:
parent
807dbee647
commit
c33e898218
@ -9,6 +9,7 @@ DB_ECHO=True
|
|||||||
# Системные переменные
|
# Системные переменные
|
||||||
SECRET_KEY=1234567890abcdefghigklmnopqrstuvwxyz
|
SECRET_KEY=1234567890abcdefghigklmnopqrstuvwxyz
|
||||||
FRONTEND_URL=http://127.0.0.1:8000/api/v1
|
FRONTEND_URL=http://127.0.0.1:8000/api/v1
|
||||||
|
ACCESS_TOKEN_EXPIRE=3600
|
||||||
|
|
||||||
# Переменные для почты
|
# Переменные для почты
|
||||||
EMAIL_HOST=smtp.yandex.ru
|
EMAIL_HOST=smtp.yandex.ru
|
||||||
|
@ -49,3 +49,8 @@ repos:
|
|||||||
args: [ "--fix", "--line-length=120" ]
|
args: [ "--fix", "--line-length=120" ]
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
args: [ "--line-length=120" ]
|
args: [ "--line-length=120" ]
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
|
rev: v1.15.0
|
||||||
|
hooks:
|
||||||
|
- id: mypy
|
||||||
|
@ -117,6 +117,8 @@ class Settings(BaseSettings):
|
|||||||
:type templates_dir: str
|
:type templates_dir: str
|
||||||
:ivar frontend_url: Адрес фронтенд-приложения.
|
:ivar frontend_url: Адрес фронтенд-приложения.
|
||||||
:type frontend_url: str
|
:type frontend_url: str
|
||||||
|
:ivar access_token_expire: Срок жизни JWT-токена
|
||||||
|
:type access_token_expire: int
|
||||||
"""
|
"""
|
||||||
|
|
||||||
db_settings: DBSettings = DBSettings()
|
db_settings: DBSettings = DBSettings()
|
||||||
@ -125,6 +127,7 @@ class Settings(BaseSettings):
|
|||||||
secret_key: SecretStr
|
secret_key: SecretStr
|
||||||
templates_dir: str = "templates"
|
templates_dir: str = "templates"
|
||||||
frontend_url: str
|
frontend_url: str
|
||||||
|
access_token_expire: int
|
||||||
|
|
||||||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf8", extra="ignore")
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf8", extra="ignore")
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ dependencies = [
|
|||||||
"celery (>=5.4.0,<6.0.0)",
|
"celery (>=5.4.0,<6.0.0)",
|
||||||
"redis (>=5.2.1,<6.0.0)",
|
"redis (>=5.2.1,<6.0.0)",
|
||||||
"itsdangerous (>=2.2.0,<3.0.0)",
|
"itsdangerous (>=2.2.0,<3.0.0)",
|
||||||
|
"pyjwt (>=2.10.1,<3.0.0)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user