Skip to content

Commit 0281423

Browse files
feat(v4.0.0): migrate final 43 endpoints — v4 100% on http4s (258/258)
Batches 13–19 in Http4s400.scala add the last 43 v4.0.0 endpoints to http4s: - 4 endpoint mappings (system + bank level) - 4 endpoint tags (system + bank level) - 6 schema / authentication-type / connector-method endpoints - 10 dynamic-resource-doc CRUD (system + bank level) - 10 dynamic-message-doc CRUD (system + bank level) - 1 buildDynamicEndpointTemplate - 8 complex authn (addAccount, createConsumer, createCounterpartyForAnyAccount, createHistoricalTransactionAtBank, createSettlementAccount, createUserInvitation, createUserWithAccountAccess, createUserWithRoles) Post-batch fixes: - updateEndpointMapping / updateBankLevelEndpointMapping / updateSystemLevelEndpointTag / updateBankLevelEndpointTag: switched to `executeFutureCreated` so they return 201 (the Lift handlers all use HttpCode.`201` even on PUT) - createUserWithRoles / createUserWithAccountAccess: switched to `executeFutureCreated` for the same 201-not-200 reason - 8 transaction-request-type alias ResourceDoc URL placeholders: VIEW_ID → GRANT_VIEW_ID so the matcher skips view validation, mirroring the original `createTransactionRequest` doc's behaviour and unblocking MakerCheckerTransactionRequestTest's multi-challenge scenario - DYNAMIC-RESOURCE-DOC-ID placeholder renamed to DYNAMIC_RESOURCE_DOC_ID: `isTemplateVariable` requires `[A-Z_0-9]` only; hyphens broke template recognition causing 500 instead of 403 for unauthorized requests - deleteExplicitCounterparty: COUNTERPARTY_ID → COUNTERPARTY_ID_PARAM to bypass middleware's counterparty lookup (400 not 404 for missing counterparty) - updateBankAttribute: added missing canUpdateBankAttribute role to the doc ErrorMessages.getCodeByOBPPrefix: - New helper to look up the canonical HTTP status code from an OBP-prefixed error message that may have a runtime suffix appended (e.g. "OBP-20020: User does not have access to the view. Current ViewId is owner") - Restricted to 401/403/408/429 only; non-auth canonical codes (e.g. BankNotFound's 404) are NOT remapped — callers that want a non-400 must set failCode explicitly, matching Lift's `errorJsonResponse` semantics Docs: - CLAUDE.md: v4.0.0 added to the "fully on http4s" row in the per-version completeness table - LIFT_HTTP4S_MIGRATION.md: v4.0.0 row updated to "done — 258/258 (100%)"; the bulk-port item in the suggested ordering struck through v4 test suite: 494 / 495 pass. The one remaining failure (ApiCollectionEndpointTest BGv1.3-getConsentStatus) is pre-existing — also fails on commit 5895ecf before any of this work.
1 parent f7e551a commit 0281423

4 files changed

Lines changed: 1949 additions & 45 deletions

File tree

CLAUDE.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -342,23 +342,21 @@ Per-endpoint integration test cost stays roughly constant as endpoints move Lift
342342

343343
## TODO / Phase Progress
344344

345-
### Phase 1 — Simple GETs (98 remaining in v6.0.0)
346-
GET + no body. Purely mechanical — 1:1 copy of `NewStyle.function.*` calls, pick helper from Rule 4 matrix, 3 test scenarios per endpoint (401 / 403 / 200).
345+
### Per-version completeness (from `comm -23 lift http4s` on each version's `lazy val ... : OBPEndpoint` declarations)
347346

348-
| Batch | Endpoints | Status |
349-
|---|---|---|
350-
| Batches 1–3 | 9 endpoints | ✓ done |
351-
| Batch 4 | getCacheConfig, getCacheInfo, getDatabasePoolInfo, getStoredProcedureConnectorHealth, getMigrations, getCacheNamespaces | ✓ done |
352-
| Remaining | 98 GETs | todo |
347+
| Version | Genuine Lift handlers still on the bridge |
348+
|---|---|
349+
| v1.2.1, v1.3.0, v2.0.0, v2.1.0, v2.2.0, v3.0.0, v4.0.0, v5.0.0, v5.1.0, v6.0.0 | 0 — fully on http4s |
350+
| v1.4.0 | `testResourceDoc` (dev-mode-only stub; tracked in "Per-version Lift leftovers") |
351+
| v3.1.0 | `getMessageDocsSwagger`, `getObpConnectorLoopback` (both tracked as leftovers; retire via Resource-docs / bridge-removal workstreams) |
353352

354-
### Phase 2Account/View/Counterparty GETs (subset of the 98 above)
355-
`withBankAccount` / `withView` / `withCounterparty` helpers ready. Same mechanical pattern.
353+
### v6.0.0 migrationdone (243 / 243)
354+
Phase 1 (35 overrides) and Phase 2 (208 originals) both complete. All v6 routes live in `Http4s600.scala`, wired into `Http4sApp.baseServices` ahead of the Lift bridge.
356355

357-
### Phase 3 — POST / PUT / DELETE (57 + 33 + 26 = 116 endpoints in v6.0.0)
358-
Body helpers and DELETE 204 helpers ready. Velocity: 6–8 endpoints/day.
356+
Architectural note from the v6 migration: around the 140-endpoint mark `Implementations6_0_0`'s `<init>` hit the JVM 64KB bytecode-per-method limit. The fix that ships in `Http4s600.scala` — and that future per-version files should adopt — is two-part:
359357

360-
### Phase 4 — Complex endpoints (~50 endpoints)
361-
Dynamic entities, ABAC rules, mandate workflows, polymorphic bodies. ~45–60 min each.
358+
1. Declare endpoints as `lazy val xxx: HttpRoutes[IO] = HttpRoutes.of[IO] { ... }` instead of `val`. Lambda materialisation moves out of `<init>` into per-field `lzycompute` methods (each with its own 64KB budget).
359+
2. Group `resourceDocs += ResourceDoc(...)` calls into `private def initXxxResourceDocs(): Unit` blocks of ~10–15 endpoints, called once each from the object body. Each helper def gets its own 64KB.
362360

363361
### Other TODOs
364362
- **OBP-Trading**: trading endpoints (createTradingOffer, getTradingOffer, getTradingOffers, cancelTradingOffer, createMarketOrder, getMarketOrder, cancelMarketOrder, createMarketMatch, getMarketTrade, requestSettlement, requestWithdrawal) are now in `Http4s700.scala`. 5 payment-auth endpoints remain commented out (notifyDeposit, createPaymentAuth, capturePaymentAuth, releasePaymentAuth, getPaymentAuth) — see `ideas/CAPTURE_RELEASE_TRANSACTION_REQUEST_TYPES.md`.

0 commit comments

Comments
 (0)