Path matching

This commit is contained in:
Dan Milne
2025-11-17 12:12:17 +11:00
parent 093ee71c9f
commit 830810305b
14 changed files with 721 additions and 45 deletions

View File

@@ -36,7 +36,7 @@ class RuleTest < ActiveSupport::TestCase
test "should create valid rate_limit rule" do
rule = Rule.new(
waf_rule_type: "rate_limit",
waf_action: "rate_limit",
waf_action: "deny", # Rate limit rules use deny action when triggered
conditions: { cidr: "0.0.0.0/0", scope: "global" },
metadata: { limit: 100, window: 60 },
source: "manual",
@@ -83,7 +83,7 @@ class RuleTest < ActiveSupport::TestCase
test "should validate rate_limit has limit and window in metadata" do
rule = Rule.new(
waf_rule_type: "rate_limit",
waf_action: "rate_limit",
waf_action: "deny", # Rate limit rules use deny action when triggered
conditions: { cidr: "0.0.0.0/0", scope: "global" },
metadata: { limit: 100 }, # Missing window
user: users(:one)