Commit f7e551a
committed
feat(v4.0.0): migrate 50 more endpoints to Http4s400 (176/258, 68%)
Batches 9–12 in Http4s400.scala add 42 real `lazy val NAME: HttpRoutes[IO]`
handlers ported from Lift, plus 8 ResourceDoc aliases reusing the existing
`createTransactionRequest` handler for the transaction-request-type variants
(ACCOUNT, ACCOUNT_OTP, SEPA, COUNTERPARTY, REFUND, FREE_FORM, SIMPLE,
AGENT_CASH_WITHDRAWAL — already covered by `literalAllCapsSegments` in
Http4sSupport).
Post-batch fixes:
- deleteExplicitCounterparty: COUNTERPARTY_ID → COUNTERPARTY_ID_PARAM in
ResourceDoc URL so middleware skips the counterparty lookup (400 vs 404
for missing IDs)
- updateBankAttribute: add canUpdateBankAttribute role to ResourceDoc so
middleware returns 403 (test expectation) instead of handler's 400
- getFastFirehoseAccountsAtOneBank: read pagination from URL query string
via extractHttpParamsFromUrl, not from headers — matching Lift v4
ErrorResponseConverter + ErrorMessages.getCodeByOBPPrefix:
- For any thrown Exception with an OBP-XXXXX prefixed message and the
default failCode=400, look up the canonical status code in
ErrorMessages.errorToCode by OBP prefix. Reproduces Lift's
errorJsonResponse behaviour (403 for UserNoPermissionAccessView,
UserHasMissingRoles, etc.; 401 for AuthenticatedUserIsRequired). Caller
who set failCode explicitly is honored.
Skipped 43 endpoints (dynamic/reflection: 31; complex authn: 12) remain
on the Lift bridge — they'll be addressed in a follow-up batch.
v4 test suite: 491 passed, 1 pre-existing failure (ApiCollectionEndpointTest
BGv1.3-getConsentStatus, fails on prior commit too).1 parent 5895ecf commit f7e551a
3 files changed
Lines changed: 1644 additions & 2 deletions
File tree
- obp-api/src/main/scala/code/api
- util
- http4s
- v4_0_0
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1032 | 1045 | | |
1033 | 1046 | | |
1034 | 1047 | | |
| |||
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
93 | | - | |
94 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
| |||
0 commit comments