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]