class

KemalWAF::RuleLoader

Inherits Reference / Object

============================================================================= Rule Loader with Immutable Snapshots

Manages rule loading and hot-reload using immutable snapshots All rule access is through snapshots for thread-safety

Constants

Log = ::Log.for("rule_loader")

Constructors

new(rule_dir : String)
Source

Instance methods

check_and_reload

Check for changes and reload if needed

Source
load_rules

Load rules and create new snapshot

Source
rule_count

Get rule count from current snapshot

Source
rules

Get current rules (lock-free through snapshot) Get current rules (returns copy for thread-safety compatibility)

Source
snapshot

Get current snapshot

Source
snapshot_version

Get current snapshot version

Source
stats

Get snapshot statistics

Source
validate_rules(rule_dir : String | Nil = nil) : NamedTuple(valid: Bool, errors: Array(String), rule_count: Int32)

Validate rules without activating (dry-run)

Source