Drop add_headers - headers can now be added to meta[] to be applied for any action. Consilidate Tagging in a service
This commit is contained in:
@@ -34,8 +34,10 @@ class EventDdb
|
||||
SQL
|
||||
|
||||
# Convert to hash like ActiveRecord .group.count returns
|
||||
# DuckDB returns arrays: [waf_action, count]
|
||||
result.to_a.to_h { |row| [row[0], row[1]] }
|
||||
# DuckDB returns integer enum values, map to string names
|
||||
# 0=deny, 1=allow, 2=redirect, 3=challenge, 4=log
|
||||
action_map = { 0 => "deny", 1 => "allow", 2 => "redirect", 3 => "challenge", 4 => "log" }
|
||||
result.to_a.to_h { |row| [action_map[row[0]] || "unknown", row[1]] }
|
||||
end
|
||||
rescue StandardError => e
|
||||
Rails.logger.error "[EventDdb] Error in breakdown_by_action: #{e.message}"
|
||||
|
||||
Reference in New Issue
Block a user