chore: initial commit of Go API gateway
CI / Test (push) Canceled after 0s
CI / Vet (push) Canceled after 0s
CI / Build (push) Canceled after 0s
CI / Security (govulncheck) (push) Canceled after 0s

Baseline for the Kong replacement on api.riotpiao.com. Brings the working
tree under version control for the first time: gateway source, the task
board that drives the agent runs, test fixtures, and K8s manifests.

Anchor the gateway ignore rule to the repo root. Unanchored, "gateway"
also matched the cmd/gateway/ source directory, so the program entrypoint
was excluded from every commit.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Story Crater Bot
2026-08-19 20:54:34 -07:00
co-authored by Claude Opus 5
commit 058f11cf2b
109 changed files with 8992 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# 0.5 — Structured logging (GREEN)
Phase: 0 — Foundations
Stage: GREEN
Depends on: [0.1](0.1-module-and-entrypoint.md)
- [ ] Logs are emitted as structured records with a consistent field set, one record per line
- [ ] Every request log carries at least: route, upstream, method, path, status, duration
- [ ] Every rejected request is logged with an explicit machine-readable reason field
- [ ] Request bodies are never logged, in whole or in part
- [ ] `Authorization` header values, bearer tokens, API keys and JWKS material are never logged, not even truncated or hashed-with-prefix
- [ ] Log level is configurable, and no level unlocks body or token logging
- [ ] A test asserts a rejected request produces exactly one record containing the reason and containing no token substring
Rejections come from several layers — unknown model, body too large, auth failure,
concurrency limit — and the reason field is what makes them countable later. The model
API carries prompts that are user content and tokens that are credentials; neither
belongs in a log line.
## Verify
```bash
go test ./internal/logging/... ./internal/server/... -run 'TestLog' -v
# expected: passes — captured log output for a rejected request contains the reason
# field and does not contain the request body or the bearer token used
```