TASK22229: P2-S2 batch 1 migrate account/login relay GET endpoints

This commit is contained in:
2026-03-24 06:58:50 +00:00
parent 312f7415f5
commit 6edbc431f8
8 changed files with 139 additions and 133 deletions
+37
View File
@@ -764,3 +764,40 @@ Follow-ups:
- P2-S2 rollout: migrate the next relay-heavy endpoint batch onto `relayGet`/shared forwarding utility pattern.
- P2-S3 hardening: add shared timeout/retry config and redacted structured relay error logging policy.
---
### CL-020: TASK22229 P2-S2 Batch 1 (account/login relay GET cluster)
date: 2026-03-24
author: Cline
scope: `pages/api/middleware/relayForwarding.js`, `pages/api/endpoint/{getaccounts_api,getemailaccountcheck_api,getpreferredlanguage_api,getlogin_api,getpersonalaccount_api,getportalloginproxy_api}.js`, `tests/phase21/endpoint-handler-contract.test.cjs`
type: change
rationale: Deliver first P2-S2 batch as a dedicated commit by migrating a bounded account/login endpoint cluster onto shared `relayGet` while preserving response contracts.
impact: Reduced relay boilerplate and improved consistency with no intended endpoint contract changes.
status: completed
Summary:
- Extended `relayGet` to support optional `requestOptionsBuilder` for handlers requiring paged header variants.
- Migrated Batch 1 endpoints to `relayGet`:
- `getaccounts_api.js`
- `getemailaccountcheck_api.js`
- `getpreferredlanguage_api.js`
- `getlogin_api.js` (uses `azureHeadersPaged` via `requestOptionsBuilder`)
- `getpersonalaccount_api.js`
- `getportalloginproxy_api.js` (uses `azureHeadersPaged` via `requestOptionsBuilder`)
- Updated phase21 endpoint contract tests to mock `relayGet` for migrated handlers, preserving existing guard/catch/success assertions.
Validation:
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
- helper: 4/4
- file-handler: 53/53
- email-handler: 12/12
- endpoint-handler: 152/152
- documents-handler: 3/3
Follow-ups:
- Continue P2-S2 with Batch 2 as next dedicated commit on this same branch.