Request log action values must say what they mean, consistently #229

Open
opened 2026-11-09 00:16:09 +01:00 by clawbot · 0 comments
Collaborator

sneak, in FIXME comments on #214, in internal/requestlog/requestlog.go, on the action values of the request log:

"too_large" doesn't tell a reader what that means. request_header_too_large does. you must not use ambiguous terms.

better would be "client_is_rate_limited"

if I saw this, i would assume they are permanently banned. is that true? if not, there should be TemporarilyBanned and PermanentlyBanned

"blocked_by_block_rule"

you have country_denied and denied. why isn't it client_denied? ALWAYS BE CONSISTENT AND UNAMBIGUOUS

Bans are not all permanent: SPEC.md has bans that last SWW_LIMIT_BAN_DURATION and bans made permanent.

Definition of done:

  • too_large becomes request_header_too_large, rate_limited becomes client_is_rate_limited, rule_blocked becomes blocked_by_block_rule, and denied becomes client_denied. These replace any other name for those values in #192 (comment).
  • banned splits into temporarily_banned and permanently_banned, by whether the ban covering the client runs out.
  • Go constants, docs/request-log.md, SPEC.md, metrics labels that carry these values, and tests follow. No aliases.
  • make check passes.

Model: opus-5-5

sneak, in FIXME comments on https://git.eeqj.de/sneak/smallwebwaf/pulls/214, in `internal/requestlog/requestlog.go`, on the `action` values of the request log: > "too_large" doesn't tell a reader what that means. request_header_too_large does. you must not use ambiguous terms. > better would be "client_is_rate_limited" > if I saw this, i would assume they are permanently banned. is that true? if not, there should be TemporarilyBanned and PermanentlyBanned > "blocked_by_block_rule" > you have country_denied and denied. why isn't it client_denied? ALWAYS BE CONSISTENT AND UNAMBIGUOUS Bans are not all permanent: `SPEC.md` has bans that last `SWW_LIMIT_BAN_DURATION` and bans made permanent. **Definition of done:** - `too_large` becomes `request_header_too_large`, `rate_limited` becomes `client_is_rate_limited`, `rule_blocked` becomes `blocked_by_block_rule`, and `denied` becomes `client_denied`. These replace any other name for those values in https://git.eeqj.de/sneak/smallwebwaf/issues/192#issuecomment-169850. - `banned` splits into `temporarily_banned` and `permanently_banned`, by whether the ban covering the client runs out. - Go constants, `docs/request-log.md`, `SPEC.md`, metrics labels that carry these values, and tests follow. No aliases. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-11-09 00:16:09 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/smallwebwaf#229