You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tornado adapter diverges from the engine request/response flow used by fastapi-guard #38
I audited the Tornado adapter against fastapi-guard, the reference adapter, and found it diverges from the engine request and response flow.
_check_bypass reimplements passthrough. A request with no client address is fully bypassed instead of getting the engine fail_secure 403, and an excluded path is fully bypassed instead of being scoped by the engine.
The route all-checks bypass is reimplemented without calling the real handler through the engine bypass handler.
The response pass runs from on_finish, after the response has already been sent. The result is discarded, so custom_response_modifier and return-rule header changes never reach the client, the body is read from an already-flushed _write_buffer so body-based return rules see nothing, and global behavior return rules are never passed.
Every request (blocked, excluded, bypassed) emits request metrics.
Security headers and CORS are reimplemented before the handler instead of coming from the engine response pass.
A Redis failure during initialization is a 500 instead of the 503 with Retry-After that fastapi-guard returns.
Expected
Route through the engine exactly where fastapi-guard does, and run the engine response pass on the outgoing response before it is flushed.
Activity