feat: populate firewall attributes and expose matched rules via verify#7
Merged
Merged
Conversation
Adds a `caseInsensitive` flag to `Condition` so value-based operators (equal, notEqual, contains, notContains, startsWith, endsWith and their negations) can compare strings without regard to letter casing. This is useful for attributes whose values are case-insensitive by nature, such as ISO country codes, where a rule authored with `il` should still match a request resolved as `IL`. - Flag defaults to false, preserving existing strict comparison behavior - Round-trips through fromArray()/toArray()/encode()/decode() - Only emitted in toArray() when enabled to keep payloads compact Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThis PR keeps rule evaluation centered on
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (6): Last reviewed commit: "feat: allow rules to carry an optional i..." | Re-trigger Greptile |
Canonicalize attributes so requestPath/RequestPath/path all resolve to the same Firewall key (mirrors Firewall request* aliases + lowercase). Co-authored-by: Cursor <cursoragent@cursor.com>
This reverts commit 5b7e0e4.
Keep attribute alias resolution inside Firewall so consumers populate request values through setAttribute() instead of rewriting condition names. Co-authored-by: Cursor <cursoragent@cursor.com>
This reverts commit 3a31fde.
Keep condition comparisons case-sensitive while validating that request values flow through Firewall attributes. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the conditions-only matches() helper. Consumers populate attributes, register ordered rules, call verify(), then inspect getLastMatchedRule(). Co-authored-by: Cursor <cursoragent@cursor.com>
Consumers can attach a stable id to matched rules so application-layer metadata does not require a separate object map. Co-authored-by: Cursor <cursoragent@cursor.com>
ArnabChatterjee20k
approved these changes
Jul 20, 2026
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
Keeps evaluation centered on the existing
Firewall::verify()API:setAttribute()/setAttributes()Ruleobjectsverify()getLastMatchedRule()for the matched rule and action metadataAttribute alias resolution stays inside
Firewall(requestPath→path, etc.). No condition-name rewriting. No parallelmatch()/matches()helpers.Test plan