fast-clean 1.2.1__py3-none-any.whl → 1.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
 
5
5
  from fastapi import APIRouter
6
6
 
7
- from fast_clean.schemas import StatusOkResponseSchema
7
+ from .schemas import StatusOkResponseSchema
8
8
 
9
9
  router = APIRouter(prefix='/health', tags=['Healthcheck'], include_in_schema=False)
10
10
 
@@ -1,8 +1,5 @@
1
- """
2
- Модуль, содержащий схемы ответов статусов.
3
- """
4
1
 
5
- from .request_response import ResponseSchema
2
+ from fast_clean.schemas.request_response import ResponseSchema
6
3
 
7
4
 
8
5
  class StatusOkResponseSchema(ResponseSchema):
fast_clean/middleware.py CHANGED
@@ -5,6 +5,8 @@
5
5
  from fastapi import FastAPI
6
6
  from starlette.middleware.cors import CORSMiddleware
7
7
 
8
+ from .contrib.monitoring.middleware import use_middleware as use_monitoring_middleware
9
+
8
10
 
9
11
  def use_middleware(app: FastAPI, cors_origins: list[str]) -> FastAPI:
10
12
  """
@@ -17,4 +19,5 @@ def use_middleware(app: FastAPI, cors_origins: list[str]) -> FastAPI:
17
19
  allow_methods=['*'],
18
20
  allow_headers=['*'],
19
21
  )
22
+ use_monitoring_middleware(app)
20
23
  return app
@@ -42,4 +42,5 @@ class CryptographyServiceFactory:
42
42
  match algorithm:
43
43
  case CryptographicAlgorithmEnum.AES_GCM:
44
44
  return AesGcmCryptographyService(self.secret_key)
45
- raise NotImplementedError(algorithm)
45
+ case _:
46
+ raise NotImplementedError(algorithm)
fast_clean/settings.py CHANGED
@@ -6,9 +6,9 @@ from __future__ import annotations
6
6
 
7
7
  import os
8
8
  from pathlib import Path
9
- from typing import ClassVar, Literal, Self
9
+ from typing import Annotated, ClassVar, Literal, Self
10
10
 
11
- from pydantic import BaseModel, ConfigDict, RedisDsn, model_validator
11
+ from pydantic import BaseModel, ConfigDict, Field, RedisDsn, model_validator
12
12
  from pydantic_settings import BaseSettings as PydanticBaseSettings
13
13
  from pydantic_settings import SettingsConfigDict
14
14
  from typing_extensions import Unpack
@@ -173,12 +173,12 @@ class CoreSettingsSchema(BaseSettingsSchema):
173
173
  """
174
174
 
175
175
  debug: bool
176
- title: str
177
176
  base_url: str
178
177
  base_dir: Path = Path(os.getcwd())
179
178
  secret_key: str
180
- cors_origins: list[str]
179
+ cors_origins: Annotated[list[str], Field(default_factory=list)]
181
180
  redis_dsn: RedisDsn | None = None
181
+ sentry_dsn: str | None = None
182
182
 
183
183
  model_config = SettingsConfigDict(
184
184
  env_file='.env',