No part imports config (closes #447) #470

Open
clawbot wants to merge 1 commits from issue-447-config-above-the-parts into next
pull from: issue-447-config-above-the-parts
Collaborator

Closes #447

No part imports config any more. config sits above the parts; only sww, waf and rproxy read it.

  • TagList, MaskZoneKey, ParseNetblock, ParseASN and ParsePercent move from config to reputation unchanged; config and metrics call them there.
  • IsHeaderName went to httpguts.ValidHeaderFieldName. rules and config both call it, and golang.org/x/net becomes a direct dependency.
  • TestHeaderNameCheckTakesTheRFC9110Characters checks the empty name and all 256 single-byte names against the character set IsHeaderName used. Bytes above 0x7f were refused by both before. The test stays as a guard.
  • TestMaskZoneKeyMasksTheFirstLabelOfAZoneUnderDqSpamhausNet moves to internal/reputation/dnsbl_test.go, assertions unchanged.

Names changed with the move:

  • reputation's own blocklist-line error errNotNetblock is now errNotNetblockLine, so the moved errNotNetblock keeps its name and message.
  • MaskZoneKey uses a new reputation constant maskedKey (********); config keeps its own masked for tokens.

Disclosure: there is no copy of IsHeaderName to compare against after the move, so the test compares httpguts with the character set IsHeaderName used, not with the function.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/447 No part imports `config` any more. `config` sits above the parts; only `sww`, `waf` and `rproxy` read it. - `TagList`, `MaskZoneKey`, `ParseNetblock`, `ParseASN` and `ParsePercent` move from `config` to `reputation` unchanged; `config` and `metrics` call them there. - `IsHeaderName` went to `httpguts.ValidHeaderFieldName`. `rules` and `config` both call it, and `golang.org/x/net` becomes a direct dependency. - `TestHeaderNameCheckTakesTheRFC9110Characters` checks the empty name and all 256 single-byte names against the character set `IsHeaderName` used. Bytes above 0x7f were refused by both before. The test stays as a guard. - `TestMaskZoneKeyMasksTheFirstLabelOfAZoneUnderDqSpamhausNet` moves to `internal/reputation/dnsbl_test.go`, assertions unchanged. Names changed with the move: - `reputation`'s own blocklist-line error `errNotNetblock` is now `errNotNetblockLine`, so the moved `errNotNetblock` keeps its name and message. - `MaskZoneKey` uses a new `reputation` constant `maskedKey` (`********`); `config` keeps its own `masked` for tokens. Disclosure: there is no copy of `IsHeaderName` to compare against after the move, so the test compares `httpguts` with the character set `IsHeaderName` used, not with the function. Model: opus-5-5
clawbot self-assigned this 2026-11-19 18:44:29 +01:00
clawbot added 1 commit 2026-11-19 18:44:29 +01:00
No part imports config (closes #447)
check / check (push) Waiting to run
f9e034b885
TagList, MaskZoneKey, ParseNetblock, ParseASN and ParsePercent move
from config to reputation; config imports them from there. rules and
config check header names with httpguts.ValidHeaderFieldName, and
IsHeaderName goes. A new test pins that check to the characters
IsHeaderName took, for the empty name and every single-byte name.

Model: opus-5-5
clawbot added the needs-review label 2026-11-19 18:44:35 +01:00
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-447-config-above-the-parts:issue-447-config-above-the-parts
git checkout issue-447-config-above-the-parts
Sign in to join this conversation.