Repository navigation
fix(extension): route passthrough, bypass and response pass through the engine like fastapi-guard - #40
Merged
Conversation
…he engine like fastapi-guard Use the engine BypassHandler for passthrough (fail_secure 403 without a client address) and for the route all-checks bypass, which now calls the real view. Run the response pass only for responses produced by the view, so blocked, preflight and bypass responses emit no request metrics. Pass global behavior return rules to the engine response pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the Flask adapter with fastapi-guard's engine routing.
BypassHandler.handle_passthrough: a request with no client address gets thefail_secure403, and excluded paths stay scoped (checks still run) instead of being skipped.BypassHandler.handle_security_bypass, calling the real view and applying the response modifier. Its response, like blocked and preflight responses, skips the response pass._after_requestonly runs the engine response pass for responses that came out of the view, so blocked, preflight and bypass responses emit no request metrics.global_behavior_rulesare passed to the engine response pass.The test that asserted the old no-client-address pass-through now asserts the 403.
Tests
New
tests/test_engine_parity.pyuses the Flask test client against the real engine handlers. Full suite with--cov-fail-under=100andpre-commit run --all-filespass.Closes #39