From ea56d6b48625b4f79e0ecf7db1f2614270655838 Mon Sep 17 00:00:00 2001 From: "@tanya_r" Date: Tue, 16 Jun 2026 14:56:03 -0300 Subject: [PATCH] docs(api): delegate rate limiting to the edge, annotate 429 The OpenAPI advertised per-IP and per-user rate limits with a 429 plus Retry-After, but no ledger code enforced them and the ledger is stateless and scaled to 10 replicas by the HPA, so per-replica counters cannot enforce a global limit. Records the decision (ADR-0013) to enforce rate limiting at the API gateway / edge and annotates the spec so the enforcer is unambiguous. The 429 contract and the 100/sec and 1000/sec targets are unchanged; no in-service rate-limiting code or dependency is added. Closes #52 --- api/openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index a421008..180da79 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -30,7 +30,7 @@ info: Cursor-based. Order is deterministic: created_at DESC, id DESC. Responses include `nextCursor` and `hasMore`. The cursor is opaque and integrity-protected. Use `?cursor=...&limit=...`. ## Rate limiting - Per-IP (100/sec) and per-user (1000/sec). 429 response includes `Retry-After`. + Enforced at the API gateway / edge, not by the ledger service (see ADR-0013). Per-IP (100/sec) and per-user (1000/sec); the edge returns `429` with `Retry-After`. version: 0.1.0 license: name: BSL 1.1 @@ -1086,7 +1086,7 @@ components: application/problem+json: schema: { $ref: '#/components/schemas/Problem' } TooManyRequests: - description: Rate limited + description: Rate limited at the API gateway / edge, not by the ledger service (see ADR-0013) headers: Retry-After: schema: { type: integer }