Skip to content

feat(v4.0.0): retire Lift dispatch layer — all endpoints now served by Http4s400#2798

Open
hongwei1 wants to merge 10 commits into
OpenBankProject:developfrom
hongwei1:develop-obp
Open

feat(v4.0.0): retire Lift dispatch layer — all endpoints now served by Http4s400#2798
hongwei1 wants to merge 10 commits into
OpenBankProject:developfrom
hongwei1:develop-obp

Conversation

@hongwei1
Copy link
Copy Markdown
Contributor

Summary

  • Rewires OBPAPI4_0_0 to use Http4s400 as the sole request handler — routes = Nil, allResourceDocs aggregated from Http4s400.resourceDocs, Implementations4_0_0 re-exported as an alias to Http4s400.Implementations4_0_0
  • Adds ApiVersion.v4_0_0 to the ResourceDocsAPIMethods skip-filter so resource-docs are served correctly with no Lift route class
  • Ports answerTransactionRequestChallenge to native http4s (was delegating to the Lift bridge which now returns 404): full maker-checker flow, multi-challenge, REJECT/SEPA-refund path
  • Adds missing PUT /banks/BANK_ID/attribute-definitions/transaction-request endpoint (was aliased to the wrong category)
  • Stubs APIMethods400.scala — original 17k-line Lift implementation preserved as comments
  • Fixes nameOf(Implementations4_0_0.*) compile errors in OBPAPI5_1_0 / OBPAPI6_0_0 after the stub (replaced with string literals)
  • Regenerates frozen_type_meta_data to include the new endpoint

Test plan

  • Full test suite: 2856 passed, 0 failed (2877 total, 21 ignored)
  • Targeted re-run of previously-failing suites: AttributeDefinitionTransactionRequestTest, MakerCheckerTransactionRequestTest, TransactionRequestsTest — all green
  • FrozenClassTest passes after frozen snapshot regeneration
  • Integration tests (Http4sServerIntegrationTest, Http4s500SystemViewsTest, Http4s700TransactionTest) pass when run in isolation — prior failures were port-8087 race conditions unrelated to this change

hongwei1 added 10 commits May 20, 2026 11:39
…UT attribute-definition endpoint

Two regressions exposed when the v4.0.0 Lift routes were retired in commit 95db087:

1. answerTransactionRequestChallenge — the Http4s400 implementation was delegating to
   Http4sLiftWebBridge which now returns 404 (no Lift v4 routes registered). Port the
   ~280-line Lift logic to native http4s: supports ChallengeAnswerJson400, maker-checker
   separation, multi-challenge flow (NEXT_CHALLENGE_PENDING), FORWARDED status, and
   the REJECT answer path for SEPA refund reversal.

2. createOrUpdateTransactionRequestAttributeDefinition — the alias in Http4s400 wrongly
   pointed to createOrUpdateTransactionAttributeDefinition (/transaction, Transaction
   category) instead of a dedicated /transaction-request endpoint with TransactionRequest
   category. Add the proper lazy val, ResourceDoc, and allRoutesWithMiddleware wiring.
   Remove the incorrect alias.

3. Http4s400.Implementations4_0_0.implementedInApiVersion — expose as an explicit member
   so ResourceDocsAPIMethods.scala can access it via APIMethods400.Implementations4_0_0.

Test fixes (also exposed by the Lift retirement):
- frozen_type_meta_data: regenerate snapshot to reflect Http4s400 endpoint names
- GetScannedApiVersionsTest: add OBPv4.0.0 to api_enabled_versions so http4s middleware
  does not 404 v4 requests during the version-filter test
- JsonSchemaValidationTest, CounterpartyLimitTest, TransactionRequestTest,
  VRPConsentRequestTest: replace nameOf(Implementations4_0_0.x) with string literals
  (the stub object no longer has an inner Implementations4_0_0 class)
- APIUtilHeavyTest: rewire to use Http4s400.resourceDocs directly with inline prop
  filtering instead of relying on OBPAPI4_0_0's Lift-registered routes
… in Http4s400

All 258 v4.0.0 endpoints have been migrated to Http4s400. This commit removes the
17,042-line Lift implementation body, keeping only a thin compatibility shim:

  object APIMethods400 { val Implementations4_0_0 = Http4s400.Implementations4_0_0 }
  trait APIMethods400  // empty — no Lift routes, no ResourceDocs

The original implementation is preserved as comments (prefixed //) for historical
reference. Callers that previously imported APIMethods400.Implementations4_0_0 still
compile — the re-export provides the same qualified name pointing to the Http4s object.

OBPAPI5_1_0 / OBPAPI6_0_0: the excludeEndpoints lists previously used
nameOf(Implementations4_0_0.xxx) macros which resolved against the Lift inner class.
Replace each with a string literal (the macro just returns the val name as a string)
so the references compile against the empty stub.
…actionRequestAttributeDefinition

v4.0.0 now properly registers the transaction-request attribute definition
endpoint in Http4s400, which was previously missing from the frozen snapshot.
…excludeEndpoints

Replace string literals with nameOf macro calls now that Http4s400.Implementations4_0_0
exposes all the required vals. Add re-export and Http4s400 import to OBPAPI5_1_0 and
OBPAPI6_0_0 so the macro resolves correctly.
…tags

OBPAPI4_0_0: replace string literals in excludeEndpoints with nameOf(OBPAPI3_1_0.Implementations1_2_1.xxx)
and nameOf(OBPAPI3_1_0.Implementations3_1_0.xxx) — resolved via stable singleton path.

Test files: restore nameOf(Implementations4_0_0.createTransactionRequestCounterparty)
in CounterpartyLimitTest, TransactionRequestTest, VRPConsentRequestTest.
…o Http4s310

getObpConnectorLoopback: returns 400+NotImplemented (mirrors Lift throw).
getMessageDocsSwagger: stub val + ResourceDoc only — real routing handled by
Http4sResourceDocs (wildcard /obp/*/message-docs/{CONNECTOR}/swagger2.0,
wired into Http4sApp before v310Routes). Both vals are required so nameOf
compiles in downstream test files after OBPAPI3_1_0 is migrated.
All 100 v3.1.0 endpoints now live in Http4s310 (wired into Http4sApp).
OBPAPI3_1_0 is retained only for resource-doc aggregation:
- allResourceDocs = collectResourceDocs(OBPAPI3_0_0.allResourceDocs, Http4s310.resourceDocs)
- routes = Nil (Lift dispatch retired)
- Re-exports Implementations3_1_0/1_2_1/2_2_0 so callers keep compiling

ResourceDocsAPIMethods: add v3.1.0 to the http4s skip filter so the
route-class filter does not empty the doc set when routes=Nil.
…orts

APIMethods310: replace 6065-line Lift implementation with empty trait stub.
object APIMethods310 re-exports Implementations3_1_0 → Http4s310 so
SystemViewsTests (which imports APIMethods310.Implementations3_1_0) compiles.

OBPAPI5_1_0/OBPAPI6_0_0: add Implementations3_1_0 = Http4s310.Implementations3_1_0
re-export + Http4s310 import so nameOf(Implementations3_1_0.xxx) in their
excludeEndpoints continues to compile after the APIMethods310 stub.
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant