|
|
|
@ -28,7 +28,6 @@ from src.enums import ResponseStatus
|
|
|
|
from src.exceptions import handle_exception
|
|
|
|
from src.exceptions import handle_exception
|
|
|
|
from src.logging import configure_logging
|
|
|
|
from src.logging import configure_logging
|
|
|
|
from src.rate_limiter import limiter
|
|
|
|
from src.rate_limiter import limiter
|
|
|
|
import config
|
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
# we configure the logging level and format
|
|
|
|
# we configure the logging level and format
|
|
|
|
@ -61,7 +60,7 @@ def get_request_id() -> Optional[str]:
|
|
|
|
return _request_id_ctx_var.get()
|
|
|
|
return _request_id_ctx_var.get()
|
|
|
|
|
|
|
|
|
|
|
|
def security_headers_middleware(app: FastAPI):
|
|
|
|
def security_headers_middleware(app: FastAPI):
|
|
|
|
is_production = config.ENV == "PROD"
|
|
|
|
is_production = False
|
|
|
|
|
|
|
|
|
|
|
|
# CSP rules
|
|
|
|
# CSP rules
|
|
|
|
csp_policy = {
|
|
|
|
csp_policy = {
|
|
|
|
|