Files
DeepTutor/requirements/guard.txt
Renn F dbd270cfdb feat(api): add opt-in fastapi-guard request screening
Add an off-by-default `security_guard` setting (system.json, with
DEEPTUTOR_GUARD_* deployment overrides) that mounts fastapi-guard's
pure-ASGI middleware in front of the routers: per-address rate limit,
IP allow/deny lists, ban list and an attack-pattern scan of path, query
and headers. Request bodies, WebSocket handshakes, Redis, CORS and
security headers are left alone.

The guard is added before the access-log and CORS middlewares so CORS
stays outermost and 429/403 responses carry CORS headers. When disabled
the package is never imported. When enabled without the package the
backend fails at startup with an install hint. fastapi-guard ships as
the optional `guard` extra (requirements/guard.txt, DEEPTUTOR_EXTRAS).
2026-10-16 16:24:52 +02:00

4 lines
176 B
Plaintext

# Mirrors pyproject.toml `[project.optional-dependencies].guard`.
# Optional request screening; off unless system.json `security_guard` is enabled.
fastapi-guard>=8.1.1,<9.0.0