feat(mcp): שער Bearer לתחבורת ה-HTTP (#231.2) #426

Merged
chaim merged 2 commits from worktree-mcp-http-auth into main 2026-08-05 08:16:58 +00:00
Showing only changes of commit 363485d025 - Show all commits

View File

@@ -38,9 +38,14 @@ from mcp.server.auth.provider import AccessToken, TokenVerifier
logger = logging.getLogger("legal_mcp.http_auth") logger = logging.getLogger("legal_mcp.http_auth")
#: Environment variable carrying the shared bearer token. Populated from #: Environment variable carrying the shared bearer token.
#: Infisical by the service unit — see docs/spec/X10-deploy-env-secrets.md. #:
TOKEN_ENV = "MCP_HTTP_TOKEN" #: Name matches the Infisical key exactly — All Infrastructure / env `main` /
#: `/apps/legal-ai` / ``MCP_HTTP_SHARED_SECRET``, tagged ``credentials``. Keeping
#: the two identical means nobody has to hold a mapping in their head, and it
#: follows the two bridge tokens already in that folder
#: (``COURT_FETCH_SHARED_SECRET``, ``LEGAL_CHAT_SHARED_SECRET``).
TOKEN_ENV = "MCP_HTTP_SHARED_SECRET"
#: Minimum acceptable token length. Short tokens are brute-forceable; refusing #: Minimum acceptable token length. Short tokens are brute-forceable; refusing
#: them at startup is cheaper than discovering it from an access log. #: them at startup is cheaper than discovering it from an access log.