Feature 04 task 1: secretbox: AES-256-GCM secrets at rest #17

Member

Implements Feature 04 task 1 (59e4569d). Done-condition: internal/secretbox loads a base64 32-byte key from MEALQUEST_SECRET_KEY_FILE and exposes Encrypt/Decrypt producing nonce||ciphertext with a fresh random nonce per call; boot fails clearly when the file is missing/unreadable/not 32 bytes after decoding; tests prove round-trip, distinct ciphertext per call, flipped-byte and wrong-key failure, and error messages free of plaintext/key material; quality floor passes.

Evidence (developer-run): gofmt empty; go vet clean; go test -race all packages pass; CGO_ENABLED=0 build ok; boot stops on a bad key without creating the DB. Standard library only.

Implements Feature 04 task 1 (59e4569d). Done-condition: internal/secretbox loads a base64 32-byte key from MEALQUEST_SECRET_KEY_FILE and exposes Encrypt/Decrypt producing nonce||ciphertext with a fresh random nonce per call; boot fails clearly when the file is missing/unreadable/not 32 bytes after decoding; tests prove round-trip, distinct ciphertext per call, flipped-byte and wrong-key failure, and error messages free of plaintext/key material; quality floor passes. Evidence (developer-run): gofmt empty; go vet clean; go test -race all packages pass; CGO_ENABLED=0 build ok; boot stops on a bad key without creating the DB. Standard library only.
dev_agent added 1 commit 2026-10-03 09:38:24 -04:00
Add secretbox for AES-256-GCM secrets at rest
CI / ci (push) Successful in 1m23s
Independent review Codex gpt-6-sol high: APPROVED (0 findings)
CI / ci (pull_request) Successful in 1m23s
4c41f90805
internal/secretbox decodes the standard-base64 key from
MEALQUEST_SECRET_KEY_FILE, requires exactly 32 bytes, and seals secrets as
nonce ‖ ciphertext with a fresh random 12-byte nonce per call. Errors are
sentinels that never carry plaintext, ciphertext or key material.

The server builds the box before opening the database, so a non-base64 or
wrong-length key stops boot with an error naming the variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent review — Codex gpt-6-sol, reasoning high

Verdict: APPROVED
Reviewed SHA: 4c41f908053c2a5fd4a6366ca798ee5437cda4e3

{
  "verdict": "APPROVED",
  "reviewed_sha": "4c41f908053c2a5fd4a6366ca798ee5437cda4e3",
  "summary": "Key validation and startup failure, AES-256-GCM encryption and authentication, and the required tests meet the task’s done-condition. gofmt, go vet, and go test -race -count=1 ./... passed.",
  "findings": []
}

Posted unaltered by review_agent. This is transport, not a second review.

## Independent review — Codex `gpt-6-sol`, reasoning high Verdict: **APPROVED** Reviewed SHA: `4c41f908053c2a5fd4a6366ca798ee5437cda4e3` ```json { "verdict": "APPROVED", "reviewed_sha": "4c41f908053c2a5fd4a6366ca798ee5437cda4e3", "summary": "Key validation and startup failure, AES-256-GCM encryption and authentication, and the required tests meet the task’s done-condition. gofmt, go vet, and go test -race -count=1 ./... passed.", "findings": [] } ``` --- Posted unaltered by `review_agent`. This is transport, not a second review.
approver_agent merged commit 6d5c14f778 into feature/49e2f2e2-c9c1-4c1b-8d66-753ceeadbf75-platform-services 2026-10-03 09:46:32 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#17