Give ban causes, limit kinds, alert events, actions and dispositions named types (closes #428)
check / check (push) Failing after 1m41s

Each fixed set of string constants becomes a named string type in the
package that owns it, and the fields and parameters that carry it use
the type: bans.Cause, ratelimit.LimitKind, alerts.Event,
alerts.DestinationName, rules.Action, requestlog.Action,
requestlog.Offence, requestlog.WAFLineKind and wafprotocol.Disposition.
Every value keeps its string, so the logs, state files, alerts and
metrics do not change.

The switches exhaustive now checks list their missing cases.

Model: opus-5-5
This commit was merged in pull request #464.
This commit is contained in:
clawbot committed 2026-11-20 00:43:20 +01:00
1 parent abf6c8d517
commit 2301a76029
43 files changed
+375 -257

No files matched your search

+1 -1
View File
@@ -62,7 +62,7 @@ type request struct {
// disposition is what is done with the request: waf's valid disposition,
// or SWW_RPROXY_WAF_BACKEND_NO_ANSWER_DISPOSITION. It is "" when neither
// gave one.
disposition string
disposition wafprotocol.Disposition
// answered is true when waf gave disposition, which makes a report due,
// and wafNoAnswer when SWW_RPROXY_WAF_BACKEND_NO_ANSWER_DISPOSITION did.
answered bool