ai-code-battle/cmd/acb-api
jedarden 6dd69f596d feat(api): add spam/word filter for feedback submission
Per plan §13.6, implement a configurable spam filter for the
handleCreateFeedback endpoint that:

- Validates minimum content length (default 10 chars, configurable
  via ACB_SPAM_MIN_LENGTH env var)
- Normalizes case and strips common unicode substitutions
  (leetspeak: 0→o, 1→i, 3→e, 4→a, 5→s, 7→t, @→a, $→s, etc.)
- Checks content against a block-list of banned terms with word-boundary
  matching
- Returns HTTP 422 (Unprocessable Entity) on filter rejection

Configuration:
- ACB_SPAM_BLOCK_LIST: comma-separated custom blocked terms (optional,
  defaults to embedded list of common spam/offensive words)
- ACB_SPAM_MIN_LENGTH: minimum feedback content length (default: 10)

The embedded default block-list includes:
- Profanity and offensive language
- Common spam patterns (buy now, click here, free money, etc.)
- Scam patterns (bitcoin giveaway, urgent, act now, etc.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 01:26:32 -04:00
..
alerts.go Add Discord/Slack alerting webhooks to Go API server 2026-03-26 01:32:47 -04:00
alerts_test.go Add Discord/Slack alerting webhooks to Go API server 2026-03-26 01:32:47 -04:00
config.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
config_test.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
crypto.go fix: accept base64-encoded AES keys (OpenBao stores keys as base64, not hex) 2026-04-30 23:04:29 -04:00
crypto_test.go fix: accept base64-encoded AES keys (OpenBao stores keys as base64, not hex) 2026-04-30 23:04:29 -04:00
db.go feat(combat): rank matches by enemy-kill combat turns 2026-05-03 18:32:08 -04:00
Dockerfile fix(docker): add COPY ratelimit/ to acb-api Dockerfile 2026-04-23 18:09:53 -04:00
health.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
main.go feat(api): add spam/word filter for feedback submission 2026-05-04 01:26:32 -04:00
mapvote_test.go fix(types): add missing ReplayPlayer import and type annotation for transcript feature 2026-04-22 18:20:56 -04:00
rotatekey_test.go fix(api): remove unused time import from rotatekey_test.go 2026-04-22 17:40:06 -04:00
server.go feat(api): add spam/word filter for feedback submission 2026-05-04 01:26:32 -04:00
server_test.go feat(api): wire voteLtr rate limiter for upvote endpoint (§13.6) 2026-04-22 17:37:34 -04:00
spamfilter.go feat(api): add spam/word filter for feedback submission 2026-05-04 01:26:32 -04:00
spamfilter_test.go feat(api): add spam/word filter for feedback submission 2026-05-04 01:26:32 -04:00