feat(feedback): link the captured IP into the ban flow (BUNYIP-436) #428
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-436-feedback-ip-ban-link"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What and why
BUNYIP-436 asked to capture the client IP and user agent on feedback and surface them so repeat spam sources can be identified and banned. The first task was to establish what the earlier BUNYIP-411 actually delivered before re-implementing anything.
Finding on BUNYIP-411 (acceptance criterion 1)
BUNYIP-411 shipped almost all of it, verified against the code on
main:submitter_ip(INET) anduser_agentexist onfeedback(migration20260730000010_feedback_request_metadata.sql).submit_feedbackpopulates both: the IP via the sharedextract_client_ipresolver, the user agent bounded to 256 chars.FeedbackSubmitted, IP inactor_ip_address, UA in the metadata JSON), and the password is never recorded.Address resolution was already correct, not a Docker IP:
submit_feedbackuses the sameextract_client_iphelper the Autoban capture uses, which trustsX-Forwarded-Foronly from a configured trusted proxy and otherwise falls back to the socket peer. The separately-tracked audit-address defect does not affect feedback, which goes through the shared resolver. So no capture, persistence, resolution, or audit work was needed here.The one remaining gap (criterion 5): make the IP actionable
The captured IP was shown as plain text with no path to a ban. This PR links it into the existing ban flow:
/admin/ip-bans?ip=<addr>(URL-encoded through the sharedurlenc).ipquery param and seeds the add-ban form's address field from it, so the admin lands on the ban screen with the address filled in and only adds a reason.admin_guard; nothing is added to any user-facing view.Acceptance criteria
resolve_client_ipunit tests) plus new tests for the prefill link.Tests and verification
just check-containergreen: fmt + clippy-D warnings+ full workspace suite (166 web tests incl. the 2 new, 312 domain, others).203.0.113.7.🤖 Generated with Claude Code
https://claude.ai/code/session_01US9AFL2ZTGrLH9TEPSmNfm