Repository navigation
feat(engine): exclude_paths matcher, reference client resolution and the shared config wiring - #143
Merged
Merged
Conversation
…ped response pass
…, cors expose headers
This was referenced Oct 15, 2026
A scratch sibling symlink to a local checkout was added in the wiring commit. It is not part of the repository.
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.
Closes #142
I am adding the engine side of the reference parity work so the four adapters can follow.
guard_core_engine::path_matching: the referenceexclude_pathsmatcher (percent-decoding for up to four rounds,\folded to/, dot segments collapsed, a/-bounded prefix match,/excluding everything). The table in the tests is recorded from the Python reference, so/staticnow covers/static/app.jsand/static/../adminis not excluded.ip_extraction:is_trusted_proxynow matches the reference (the connecting text must parse, a bare entry compares as text, a CIDR entry contains the address within its own family), so an IPv4-mapped peer no longer matches a plain IPv4 proxy entry or an IPv4 CIDR, an empty peer is no peer, and a zone-identified IPv6 literal keeps its zone. Newresolve_clientis the one call an adapter makes per request, including the 403Client address could not be determinedrejection underfail_securefor a peer-less request. The recorded table is in the tests.ResponseProcessor:process_scoped(the excluded-path pass: no return rules, headers, CORS and the modifier still run),apply_modifier(the modifier alone, for an all-checks-bypass route),needs_response_bodyandmax_inspect_bytes, and the CORS handler headers (Vary: Origin,Access-Control-Expose-Headers) after the modifier.CorsConfiggainsexpose_headers.guard_core_rs::wiring: oneSecurityConfigto pipeline mapping, so each adapter installs parts instead of mapping fields itself. The module docs carry the field-by-field table. It builds the geo country stage and handler, the cloud-provider stage with the interval-driven refresh, the limiter withendpoint_rate_limitsand the auto-ban flag, the ban manager and the HTTPS stage with the configured trusted proxies, the custom request check and auth verifier stages, the response pass with the modifier andon_error, the Redis stores behind theredisfeature, and the event bus, metrics collector and dynamic-rule driver over an injected agent.The adapter PRs (tower, axum, actix, rocket) depend on this API: their CI checks out the engine master as the sibling, so they stay red until this merges. Merge order: this PR, then tower, then axum (it composes tower), then actix and rocket in any order.
Gates run locally: fmt, clippy (workspace, all targets, and the PyO3 crate with all features) with
-D warnings, the pattern-probe child build, the workspace tests including the three conformance gates,cargo docwith-D warnings, the MSRV 1.92 check and tests, and the 100% line coverage gate. The Redis arm of the wiring compiles and passes its own tests with--features redisbut is outside the default coverage build, like the rest ofredis_store. One local flake showed up while I ran the coverage gate on macOS: thecloud_fetchstub tests (a stub server can read the request before the client wrote it) failed a different test in each of three consecutive runs, and the runs after that passed, including the final 100% gate and the MSRV test run.