feat(V2): bearer auth middleware con compare_digest

Implementa install_auth_middleware con whitelist /health /apidocs /openapi.json,
token timing-safe via secrets.compare_digest, request.state.environment injection.
Fix pyproject: --import-mode=prepend (importlib + PEP563 rompe FastAPI Request injection).
Rimosso from __future__ import annotations da test_auth.py per stesso motivo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
AdrianoDev
2026-04-30 18:09:21 +02:00
parent 97d93a5139
commit 2934a2d26a
3 changed files with 161 additions and 1 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ extend-immutable-calls = [
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = "--import-mode=importlib"
addopts = "--import-mode=prepend"
[tool.mypy]
python_version = "3.11"