From c33e898218e91ee067d3b1494470deace525045d Mon Sep 17 00:00:00 2001 From: proDream Date: Thu, 10 Apr 2025 12:48:10 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=D1=8B=D0=B5=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8?= =?UTF-8?q?=D0=BC=D0=BE=D1=81=D1=82=D0=B8=20=D0=B8=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Добавлена зависимость pyjwt для работы с JWT-токенами. - Обновлен файл .pre-commit-config.yaml, добавлен хук mypy для проверки типов. - Внесены изменения в .env.example для поддержки нового параметра ACCESS_TOKEN_EXPIRE. - Добавлен новый атрибут access_token_expire в класс Settings в lkeep/core/settings.py. --- .env.example | 1 + .pre-commit-config.yaml | 5 +++++ lkeep/core/settings.py | 3 +++ pyproject.toml | 1 + 4 files changed, 10 insertions(+) diff --git a/.env.example b/.env.example index 094f6c0..4ad6fdd 100644 --- a/.env.example +++ b/.env.example @@ -9,6 +9,7 @@ DB_ECHO=True # Системные переменные SECRET_KEY=1234567890abcdefghigklmnopqrstuvwxyz FRONTEND_URL=http://127.0.0.1:8000/api/v1 +ACCESS_TOKEN_EXPIRE=3600 # Переменные для почты EMAIL_HOST=smtp.yandex.ru diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9decd09..96cdab9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,3 +49,8 @@ repos: args: [ "--fix", "--line-length=120" ] - id: ruff-format args: [ "--line-length=120" ] + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.15.0 + hooks: + - id: mypy diff --git a/lkeep/core/settings.py b/lkeep/core/settings.py index d817d89..543f43e 100644 --- a/lkeep/core/settings.py +++ b/lkeep/core/settings.py @@ -117,6 +117,8 @@ class Settings(BaseSettings): :type templates_dir: str :ivar frontend_url: Адрес фронтенд-приложения. :type frontend_url: str + :ivar access_token_expire: Срок жизни JWT-токена + :type access_token_expire: int """ db_settings: DBSettings = DBSettings() @@ -125,6 +127,7 @@ class Settings(BaseSettings): secret_key: SecretStr templates_dir: str = "templates" frontend_url: str + access_token_expire: int model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf8", extra="ignore") diff --git a/pyproject.toml b/pyproject.toml index d5a50a6..7d89aca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ dependencies = [ "celery (>=5.4.0,<6.0.0)", "redis (>=5.2.1,<6.0.0)", "itsdangerous (>=2.2.0,<3.0.0)", + "pyjwt (>=2.10.1,<3.0.0)", ] [build-system]