2 Commits

Author SHA1 Message Date
6f5cff1b57 fix(gateway): REST facade's JSON body decode had no size cap — a single unauthenticated request could balloon memory by the full body size
decodeJSONBody (IssueCard, AdjustCardLimit, RationBridgeFunding,
SimulateDeposit) read r.Body with a bare json.NewDecoder and no bound,
before any auth check ever ran. Reproduced live: one unauthenticated
300MB POST to /v1/cards drove gateway's RSS from ~20MB to ~1.3GB in
~5.6s. Capped at 1MB via http.MaxBytesReader (same limit and
justification services/webhook-ingestion's handler already uses for
the identical class of payload), mapped to a 413 instead of the
existing 400. Verified live post-fix: the same 300MB body now returns
413 in ~2.5ms with RSS flat at ~25MB; real IssueCard/AdjustCardLimit/
SimulateDeposit/RationBridgeFunding round-trips through the REST
facade with a real minted API key still succeed unchanged. go build/
go vet/go test clean for services/gateway, full make build (Rust+Go+
SDK) clean, 0 regressions.
2026-10-29 16:22:51 +03:00
521d6176c4 feat(ration): REST/JSON facade over gateway, final phase-2 doc updates
Phase 2 section 7 (the other half, alongside sdk/go/ration and
sdk/rust/ration-client already pushed in c5297e4/8215fb8): a hand-rolled
internal/httpapi on services/gateway translating JSON <-> the gRPC source
of truth (cards, deposits, bridge funding, activity), documented as a
convenience facade over gRPC, not a parallel implementation. Also folds in
the remaining phase-2 doc updates (ARCHITECTURE/RUNBOOK/THREAT-MODEL/
AIRWALLEX-SETUP/SUBMISSION, ADR 0003/0004) and docker-compose/Makefile/
.env.example wiring from the resumed phase-2 workflow's final agents.

Verified: go build/vet/test clean across all 10 services + both new SDKs,
`make build && make test` clean end to end (C WAL, Rust ledger-core + the
new Rust SDK, every Go module including sdk/go/ration).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-19 12:56:58 +03:00