Give ban causes, limit kinds, alert events, actions and dispositions named types (closes #428)
check / check (push) Failing after 3m31s
check / check (push) Failing after 3m31s
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 is contained in:
1 parent
51989235d6
commit
0835a35df5
42 files changed
+364
-248
No files matched your search
@@ -794,7 +794,9 @@ func readResponse(t *testing.T, conn net.Conn) answer {
|
||||
}
|
||||
|
||||
// wantLine checks the request log line's status and action.
|
||||
func wantLine(t *testing.T, line logLine, status int, action string) {
|
||||
func wantLine(
|
||||
t *testing.T, line logLine, status int, action requestlog.Action,
|
||||
) {
|
||||
t.Helper()
|
||||
|
||||
if line.Status != status || line.Action != action {
|
||||
|
||||
Reference in new issue
Block a user