feat(v4.0.0): retire Lift dispatch layer — all endpoints now served by Http4s400#2798
Open
hongwei1 wants to merge 10 commits into
Open
feat(v4.0.0): retire Lift dispatch layer — all endpoints now served by Http4s400#2798hongwei1 wants to merge 10 commits into
hongwei1 wants to merge 10 commits into
Conversation
…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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
OBPAPI4_0_0to useHttp4s400as the sole request handler —routes = Nil,allResourceDocsaggregated fromHttp4s400.resourceDocs,Implementations4_0_0re-exported as an alias toHttp4s400.Implementations4_0_0ApiVersion.v4_0_0to theResourceDocsAPIMethodsskip-filter so resource-docs are served correctly with no Lift route classanswerTransactionRequestChallengeto native http4s (was delegating to the Lift bridge which now returns 404): full maker-checker flow, multi-challenge, REJECT/SEPA-refund pathPUT /banks/BANK_ID/attribute-definitions/transaction-requestendpoint (was aliased to the wrong category)APIMethods400.scala— original 17k-line Lift implementation preserved as commentsnameOf(Implementations4_0_0.*)compile errors inOBPAPI5_1_0/OBPAPI6_0_0after the stub (replaced with string literals)frozen_type_meta_datato include the new endpointTest plan
AttributeDefinitionTransactionRequestTest,MakerCheckerTransactionRequestTest,TransactionRequestsTest— all greenFrozenClassTestpasses after frozen snapshot regenerationHttp4sServerIntegrationTest,Http4s500SystemViewsTest,Http4s700TransactionTest) pass when run in isolation — prior failures were port-8087 race conditions unrelated to this change