waf: Server exports no parts (closes #436) #455

Open
clawbot wants to merge 1 commits from issue-436-server-exports-no-parts into next
pull from: issue-436-server-exports-no-parts
Collaborator

waf.Server keeps only its embedded *http.Server; waf.New copies no parts out of the handler. Closes #436.

The tests keep the parts themselves. No test assertion changes.

New names in the test helpers (internal/waf/proxy_test.go):

  • wafAndParts: the server with the waf.Params it was built from. It embeds both, so server.Ledger and server.Addr still read as before. Every helper that returned or took *waf.Server now uses it.
  • wafAndParts.banAbuseIPDBBlacklist: calls waf.BanAbuseIPDBBlacklist with the kept parts. It replaces the method export_test.go had on *waf.Server, which reached into the handler. export_test.go now holds only BesideLookupTimeLimit.

What the diff does not make obvious:

  • newWAFWith now takes change func(*waf.Params), applied before waf.New, in place of a build func(waf.Params) *waf.Server. With the old shape, the Core Rule Set test's builder changed its own copy of the Params, so the copy the test kept would not have been the one the server was built from.

Model: opus-5-5

`waf.Server` keeps only its embedded `*http.Server`; `waf.New` copies no parts out of the handler. Closes https://git.eeqj.de/sneak/smallwebwaf/issues/436. The tests keep the parts themselves. No test assertion changes. New names in the test helpers (`internal/waf/proxy_test.go`): - `wafAndParts`: the server with the `waf.Params` it was built from. It embeds both, so `server.Ledger` and `server.Addr` still read as before. Every helper that returned or took `*waf.Server` now uses it. - `wafAndParts.banAbuseIPDBBlacklist`: calls `waf.BanAbuseIPDBBlacklist` with the kept parts. It replaces the method `export_test.go` had on `*waf.Server`, which reached into the handler. `export_test.go` now holds only `BesideLookupTimeLimit`. What the diff does not make obvious: - `newWAFWith` now takes `change func(*waf.Params)`, applied before `waf.New`, in place of a `build func(waf.Params) *waf.Server`. With the old shape, the Core Rule Set test's builder changed its own copy of the Params, so the copy the test kept would not have been the one the server was built from. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 17:40:06 +01:00
clawbot self-assigned this 2026-11-19 17:40:06 +01:00
clawbot added 1 commit 2026-11-19 17:40:07 +01:00
waf: Server exports no parts (closes #436)
check / check (push) Waiting to run
ac46289c62
waf.Server held its parts as public fields only for the tests to read.
The tests now keep the Params the server was built from in a test-only
wafAndParts, which embeds both, so every assertion reads as before.
newWAFWith takes a change to the Params instead of a build function, so
the Params kept are the ones the server was built from.

Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: ac46289c62

waf.Server now exports no parts and the tests read the same pointers through wafAndParts with no assertion changed, which meets the definition of done of #436.

Model: opus-5-5

Verdict: PASS Head: ac46289c62eae4e0af82c08e317feb1542c878d8 `waf.Server` now exports no parts and the tests read the same pointers through `wafAndParts` with no assertion changed, which meets the definition of done of https://git.eeqj.de/sneak/smallwebwaf/issues/436. Model: opus-5-5
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.
This branch is out-of-date with the base branch
View command line instructions

Checkout

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