feat(relay): add portal endpoint relayPolicy overrides and contract checks

This commit is contained in:
2026-03-24 15:44:09 +00:00
parent e0510f9e8f
commit 0a5819803e
6 changed files with 195 additions and 0 deletions
+32
View File
@@ -1337,3 +1337,35 @@ Validation:
Follow-ups:
- Optional next slice: apply relayPolicy declarations to remaining relayGet endpoints in coherent batches (portal module/documents/DNS groups) and standardize policy presets in one shared constants module.
---
### CL-036: TASK22242 portal-facing relayPolicy parity (login + module endpoints)
date: 2026-03-24
author: Cline
scope: `pages/api/endpoint/{getportallogin_api,getportalloginproxy_api,getportalmoduledetails_api,getportalmoduledetailsproxy_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
type: change
rationale: Complete the next practical relay policy rollout slice by bringing portal-facing login/module endpoints onto explicit per-endpoint timeout/retry posture.
impact: Improves predictability and operational tuning for portal-facing relay GET flows without changing API contracts.
status: completed
Summary:
- Added explicit `relayPolicy` for four portal-facing endpoints:
- `getportallogin_api` -> strict/no-retry profile (`maxRetries: 0`, tighter timeout)
- `getportalloginproxy_api` -> low-retry account lookup profile (`maxRetries: 1`)
- `getportalmoduledetails_api` -> bounded read profile (`maxRetries: 2`)
- `getportalmoduledetailsproxy_api` -> bounded read profile (`maxRetries: 2`)
- Kept method explicit (`GET`) in each endpoint policy object.
- Extended phase21 endpoint tests with relayPolicy propagation assertions for all four endpoints.
Validation:
- `node tests/phase21/endpoint-handler-contract.test.cjs` -> pass (159/159)
- `node tests/phase21/relay-forwarding-hardening.test.cjs` -> pass (10/10)
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
Follow-ups:
- Optional next slice: extract shared relay policy presets into constants to reduce duplication and enforce profile consistency across remaining relayGet endpoints.