ai-code-battle/cmd/acb-api
jedarden 6bfd3e6679 feat(api): implement POST /api/request-enrichment endpoint
Per plan §13.3, implements user-requested AI replay commentary with:
- HMAC bot authentication via shared_secret
- Rate limiting: 5 requests/day per bot
- Match validation (exists and completed)
- Idempotency via enrichment_requested_at column
- Enqueues to Valkey for acb-enrichment service
- Returns 202 Accepted with estimated wait time

Also adds:
- AllowN() method to ratelimit package for multi-token checks
- enrichment_requested_at column to matches table (idempotency)
- enrichLtr rate limiter (5/day per bot)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 02:58:11 -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(api): implement POST /api/request-enrichment endpoint 2026-05-04 02:58:11 -04:00
Dockerfile fix(docker): add COPY ratelimit/ to acb-api Dockerfile 2026-04-23 18:09:53 -04:00
enrichment_test.go feat(api): implement POST /api/request-enrichment endpoint 2026-05-04 02:58:11 -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): implement POST /api/request-enrichment endpoint 2026-05-04 02:58:11 -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): implement POST /api/request-enrichment endpoint 2026-05-04 02:58:11 -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