docs(memory-bank): record relay hardening policy baseline and operating knobs

This commit is contained in:
2026-03-24 11:55:24 +00:00
parent 4e390491c0
commit f12a719a1e
3 changed files with 75 additions and 0 deletions
+25
View File
@@ -64,3 +64,28 @@ Example paths:
- `locales/en/**`, `locales/cy/**`
- `next.config.js`, `i18n.js`
### P-003: Shared Relay Policy via Middleware (No Endpoint Drift)
date: 2026-03-24
author: Cline
scope: `pages/api/middleware/relayForwarding.js`, `pages/api/endpoint/*_api.js` relay GET handlers
type: pattern
rationale: Keep reliability and logging policy centralized so endpoint handlers remain thin and behavior stays consistent as relay surface evolves.
impact: Reduces duplication/drift in timeout/retry/error behavior and supports safer incremental endpoint migration/hardening.
status: accepted
Pattern:
Implement retry/timeout/redacted structured logging in shared relay middleware and keep endpoint handlers focused on validation, transform, and route-level response contracts.
When to use:
- Any new or migrated relay-backed endpoint
- Any relay reliability/logging policy update
Example paths:
- `pages/api/middleware/relayForwarding.js`
- `pages/api/endpoint/getadvancedsearch_api.js`
- `pages/api/endpoint/getdnscoords_api.js`
- `tests/phase21/relay-forwarding-hardening.test.cjs`