writeonce/docs/examples/porch/middleware
shoney.arickathil bf343045ab feat(porch-store): Idempotent middleware (Phase C, in progress)
- replays a stored response for a repeated Idempotency-Key: before()
  checks the key, after() stores status/body/content-type on a 2xx/3xx
- key is "idem:<header>:<value>", optionally plus a sha256 digest of
  method|path|body when include_body is set
- 409 while a key is in flight (stored within the last 10s), lazy TTL
  expiry on access, default 24h
- replay allowlists content-type only — never Set-Cookie or Date
- backed by IdempotencyKey from Phase A (519d411)

Written by a parallel session and committed here as-is because its
branch was consolidated away. NOT verified: it calls json.decode and
json.encode without a `use json` import, which every other example that
uses json has. Left unedited rather than fixed blind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit aee79264095eea3b2c38c92789c44b31f1c9ef8a)
2026-09-15 01:15:30 +02:00
..
idempotent.wo feat(porch-store): Idempotent middleware (Phase C, in progress) 2026-09-15 01:15:30 +02:00
limiter.wo feat(porch-store): Limiter middleware (Phase B) 2026-09-15 01:15:30 +02:00
store.wo feat(porch-store): store tables for rate limit + idempotency (Phase A) 2026-09-15 01:15:30 +02:00