|
|
|
@ -13,6 +13,7 @@ from pydantic import ValidationError
|
|
|
|
|
|
|
|
|
|
|
|
from slowapi import _rate_limit_exceeded_handler
|
|
|
|
from slowapi import _rate_limit_exceeded_handler
|
|
|
|
from slowapi.errors import RateLimitExceeded
|
|
|
|
from slowapi.errors import RateLimitExceeded
|
|
|
|
|
|
|
|
from slowapi.middleware import SlowAPIMiddleware
|
|
|
|
from sqlalchemy import inspect
|
|
|
|
from sqlalchemy import inspect
|
|
|
|
from sqlalchemy.exc import SQLAlchemyError
|
|
|
|
from sqlalchemy.exc import SQLAlchemyError
|
|
|
|
from sqlalchemy.orm import scoped_session
|
|
|
|
from sqlalchemy.orm import scoped_session
|
|
|
|
@ -56,6 +57,8 @@ app.add_exception_handler(SQLAlchemyError, handle_exception)
|
|
|
|
from src.context import set_request_id, reset_request_id, get_request_id
|
|
|
|
from src.context import set_request_id, reset_request_id, get_request_id
|
|
|
|
|
|
|
|
|
|
|
|
app.add_middleware(RequestValidationMiddleware)
|
|
|
|
app.add_middleware(RequestValidationMiddleware)
|
|
|
|
|
|
|
|
app.add_middleware(SlowAPIMiddleware)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.middleware("http")
|
|
|
|
@app.middleware("http")
|
|
|
|
|