Commit Graph

14886 Commits

Author SHA1 Message Date
hongwei
de2ed5f61a refactor(api): update authentication error handling to use AuthenticatedUserIsRequired
- Replaced instances of UserNotLoggedIn with AuthenticatedUserIsRequired across multiple API versions and utility classes.
- Updated error response handling in ResourceDocMiddleware and APIUtil to reflect the new authentication requirement.
- Ensured consistency in error messages and improved clarity in authentication checks throughout the codebase.
2026-01-20 15:21:57 +01:00
hongwei
8f2048c89e Merge remote-tracking branch 'refs/remotes/Hongwei/developPom' into develop 2026-01-20 15:04:45 +01:00
hongwei
69ae30b78c refactor/(ResourceDocMiddleware): improve JSON content type handling in responses
- Updated ensureJsonContentType method to use pattern matching for content type validation.
- Ensured that responses with a media type of application/json retain their content type.
- Simplified response handling logic for better clarity and maintainability.
2026-01-20 14:11:40 +01:00
hongwei
b4ddcd6be1 refactor/ (ResourceDocMiddleware): ensure JSON content type for responses
- Introduced a new private method to enforce JSON content type on responses.
- Added `Content-Type` import and defined a constant for application/json.
- Updated response handling to apply JSON content type if not already set.
2026-01-20 13:58:31 +01:00
hongwei
98a6e2be9a feature/(http4s700): implement getBanks endpoint with proper context handling
- Replace static API info response with dynamic banks retrieval
- Add Http4sCallContextBuilder to extract request context and API version
- Integrate NewStyle.function.getBanks for fetching bank data from backend
- Use IO.fromFuture to handle asynchronous bank retrieval operations
- Convert bank data to JSON using JSONFactory400.createBanksJson
- Maintain consistent response formatting with jsonContentType header
- Enable proper call context propagation through the request lifecycle
2026-01-20 13:23:24 +01:00
hongwei
4f9c195fbe refactor/(api): streamline API structure and enhance maintainability
- Refactored multiple API classes across various versions to improve code organization and readability.
- Centralized common functionalities and reduced redundancy in API implementations.
- Enhanced error handling and logging mechanisms for better debugging and traceability.
- Updated tests to align with the refactored API structure, ensuring comprehensive coverage and reliability.
2026-01-20 13:12:11 +01:00
hongwei
c5e6b11e11 refactor/(api): centralize API info properties in APIUtil
- Introduced centralized properties for hosted organization details, including email, phone, and website.
- Updated JSONFactory classes to utilize the new centralized properties instead of direct property retrieval.
- Simplified API info JSON generation by reducing redundancy in property access.
- Enhanced clarity and maintainability of API information retrieval across different API versions.
2026-01-20 12:39:02 +01:00
hongwei
ddee799b74 feature/(http4s): add counterparty validation to ResourceDocMiddleware
- Implement counterparty existence validation in ResourceDocMiddleware step 6
- Extract BANK_ID, ACCOUNT_ID, and COUNTERPARTY_ID from path parameters
- Call NewStyle.function.getCounterpartyTrait with extracted IDs for validation
- Handle successful counterparty retrieval with updated CallContext
- Convert APIFailureNewStyle exceptions to appropriate error responses
- Return 404 CounterpartyNotFound error for invalid counterparty IDs
- Add new GET endpoint for retrieving counterparty by ID with middleware
- Register ResourceDoc for getCounterpartyByIdWithMiddleware endpoint
- Document complete validation chain in endpoint description
- Include counterparty endpoint in allRoutes combined route handler
- Enables automatic counterparty validation through middleware pipeline
2026-01-19 16:37:39 +01:00
hongwei
a53bcf4ca2 refactor/(http4s): reorder validation chain to check roles before bank validation
- Move role authorization check to execute immediately after authentication
- Reorder validation sequence: auth → roles → bank → account → view → counterparty
- Remove redundant debug logging for errorResponseBodies
- Remove inline comments explaining anonymous access flow
- Simplify bank validation logic by removing unnecessary comments
- Update validation chain documentation to reflect new execution order
- Improve early authorization failure detection before expensive bank lookups
2026-01-19 16:12:47 +01:00
hongwei
64d7219482 refactor/(http4s): enhance ResourceDocMiddleware with logging and authentication improvements
- Implement MdcLoggable for structured logging in ResourceDocMiddleware
- Update authentication checks to include role validation for unauthenticated users
- Replace println statements with logger.debug for better log management
- Refactor role authorization logic to improve clarity and error handling
- Update Http4s700 API info to include $UserNotLoggedIn in error responses
2026-01-19 12:28:59 +01:00
hongwei
64b1ac3c9d feature/(directlogin): add http4s support for DirectLogin authentication
- Add `validatorFutureWithParams` function to validate DirectLogin parameters extracted from CallContext without depending on S.request
- Enhance `getUserFromDirectLoginHeaderFuture` to prefer DirectLogin parameters from CallContext (http4s path) and fall back to S.request (Lift path)
- Improve `extractDirectLoginParams` to support both new format (DirectLogin header) and old format (Authorization: DirectLogin header)
- Enhance `parseDirectLoginHeader` to match Lift's parsing logic with support for quoted and unquoted parameter values
- Update Http4s700 API info to remove UserNotLoggedIn error and add canGetRateLimits role requirement
- This enables DirectLogin authentication to work seamlessly in http4s context where S.request is unavailable
2026-01-16 15:59:26 +01:00
hongwei
2d139b157e refactor/(Http4s700): remove user authentication message from API info 2026-01-16 14:49:33 +01:00
hongwei
85463319a8 test/(Http4s700): add UserNotLoggedIn error response to API info
- Add $UserNotLoggedIn to the error response list in apiInfoJSON
- Include authentication error handling in API v7.0.0 documentation
- Improve API error response completeness for unauthenticated requests
2026-01-16 14:26:11 +01:00
hongwei
7011677a64 refactor/(http4s): enhance ResourceDocMiddleware authentication flow and logging
- Add debug logging for authentication requirements and error response bodies
- Extract needsAuthentication check into variable for clarity and reusability
- Improve anonymous access handling to gracefully handle auth errors without failing
- Add detailed logging for anonymous access success and failure cases
- Update Http4s700 root endpoint to use correct authentication message flag
- Remove misleading comment about $UserNotLoggedIn triggering automatic auth check
- Enhance error handling in anonymous access path to allow unauthenticated endpoints to function properly
2026-01-16 14:21:22 +01:00
hongwei
bae97edc79 refactor/(http4s): improve ResourceDoc matching and error handling
- Strip API prefix (/obp/vX.X.X) from request paths before matching against ResourceDoc templates
- Add apiPrefixPattern regex to ResourceDocMatcher for consistent path normalization
- Refactor ResourceDocMiddleware.apply to properly handle OptionT wrapping
- Enhance authentication error handling with proper error response conversion
- Improve bank lookup error handling with ErrorResponseConverter integration
- Replace manual Response construction with ErrorResponseConverter.createErrorResponse calls
- Add JSON parsing fallback for exception messages in authentication flow
- Simplify validation chain logic by removing redundant comments and consolidating code paths
- Fix flatMap usage in authentication and bank lookup to properly handle IO operations
2026-01-16 14:10:57 +01:00
hongwei
4ffd9474df refactor/build: Reduce memory allocation for tests and remove parallel execution settings 2026-01-16 12:23:21 +01:00
hongwei
58a9c0b834 refactor/build: Simplify Scala plugin configs and adjust JVM arguments 2026-01-16 12:21:09 +01:00
hongwei
2c9af4e851 feature/ (http4s): add comprehensive Http4s utilities and middleware support
- Add ErrorResponseConverter for converting OBP errors to http4s Response[IO]
- Add Http4sSupport with CallContext builder and vault keys for request attributes
- Add ResourceDocMiddleware for validation chain middleware in http4s
- Add Http4sSupport package object with utility functions and type aliases
- Update Http4s700 to integrate new middleware and error handling utilities
- Remove Http4sResourceDocSupport in favor of consolidated Http4sSupport module
- Consolidate Http4s-related utilities into dedicated util/http4s package for better organization and reusability
2026-01-16 09:33:43 +01:00
karmaking
57f9f30a44 add Github actions conditionals 2026-01-15 11:45:30 +01:00
hongwei
f58fb77c5d refactor/(api): update CallContext logic and introduce Http4s utilities
- Refactor `getUserAndSessionContextFuture` to prioritize `CallContext` fields over `S.request` for http4s compatibility
- Introduce `Http4sResourceDocSupport` with utilities for validation, middleware, and error handling
- Remove redundant middleware and unused `CallContext` definition in `Http4s700`
- Improve modularity and enable http4s request handling in v7.0.0 API routes
2026-01-15 11:08:14 +01:00
Simon Redfern
efb2d6e7b4
Merge pull request #2658 from simonredfern/develop
Various New Features
2026-01-15 10:46:23 +01:00
simonredfern
c40e033e77 Merge remote-tracking branch 'origin/develop' into develop
Fixed following

# Conflicts:
#	.github/workflows/build_container_develop_branch.yml
#	.github/workflows/build_container_non_develop_branch.yml
#	.github/workflows/build_pull_request.yml
2026-01-15 10:43:32 +01:00
hongwei
59ae64b4a0 rafactor/(.gitignore): add .kiro to ignored files list 2026-01-15 10:41:57 +01:00
simonredfern
f5dd612088 Merge upstream/develop into develop after conflict resolution 2026-01-14 16:21:47 +01:00
karmaking
3a264ed326 fix Github Action 2026-01-14 14:44:19 +01:00
simonredfern
439423fc4d Adding SuperAdmin Entitlement 2 2026-01-14 14:08:15 +01:00
simonredfern
423c0c17bd JKS endpoint tagged OAuth and OIDC 2 adding tags - and adding SuperAdmin Entitlement 2026-01-14 13:44:02 +01:00
simonredfern
ae599cef45 JKS endpoint tagged OAuth and OIDC 2026-01-14 13:30:33 +01:00
simonredfern
9eb9843066 Execute Policy endpoint 2026-01-14 09:55:02 +01:00
simonredfern
f95e8b8645 ABAC Policy instead of tag 2026-01-14 09:32:23 +01:00
simonredfern
d95189e36f Aligning ABAC examples with actual field names 2026-01-13 19:07:23 +01:00
simonredfern
9576a5ccc7 Feature: ABAC has entitlements for auth user and obo user 2026-01-13 17:27:10 +01:00
simonredfern
63b46b77f2 Docfix: Fewer ABA examples part 2 2026-01-13 17:27:10 +01:00
simonredfern
09e8c6c48f Docfix: Fewer ABA examples part 1 2026-01-13 17:27:10 +01:00
simonredfern
8698c8c0b5 Changed role name to canGetSystemConnectorMethodNames 2026-01-13 17:27:10 +01:00
simonredfern
4fe6775029 CanGetMethodRoutingNames 2026-01-13 17:27:10 +01:00
simonredfern
17f9677f1d flushall_build_and_run only liftweb run once again 2026-01-13 17:27:10 +01:00
hongwei
b9ca1591f4 test/fixed failed tests 2026-01-13 17:27:10 +01:00
simonredfern
e5dd7c4481 flushall build and run runs http4s as well 2026-01-13 17:27:10 +01:00
hongwei
886bbf04f6 refactor/code clean 2026-01-13 17:27:10 +01:00
hongwei
9e6cc0fb87 docfix/tweaked the default port for http4s 2026-01-13 17:27:10 +01:00
karmaking
bb8af5059d fix restore build pipeline 2026-01-13 17:27:10 +01:00
hongwei
2ab1f4ff3e test/ApiVersionUtilsTest: Update expected version count to 25 2026-01-13 17:26:49 +01:00
hongwei
46bf0ddcfe docfix/Update .gitignore to exclude .trae files 2026-01-13 17:26:49 +01:00
hongwei
f816f230b5 feature/Enhance resource docs handling for v7.0.0
- Update `getResourceDocsList` to include v7.0.0 in `ResourceDocsAPIMethods`
- Modify `Http4s700` to utilize centralized `ResourceDocs140` for fetching resource docs
- Simplify resource docs filtering logic for v7.0.0 with tailored handling
2026-01-13 17:26:49 +01:00
hongwei
4a0eded98c refactor/Http4sServer: Update default http4s.port from 8181 to 8086 2026-01-13 16:38:23 +01:00
hongwei
da29c29c40 feature/Support API version 7.0.0
- Add `v7_0_0` to supported API versions in `ApiVersionUtils`
- Update `Http4s700` to return pre-defined resource docs instead of scanning for version 7.0.0
2026-01-13 16:38:23 +01:00
hongwei
ad7b6fe357 refactor(Http4sServer): Reorder service initialization and improve comments 2026-01-13 16:38:23 +01:00
hongwei
7c9095f0aa feature/Get resource docs endpoint for v7.0.0
- Introduce `getResourceDocsObpV700` to handle resource docs retrieval for API version 7.0.0
- Add `getResourceDocsList` helper function for fetching version-specific resource docs
- Update `allRoutes` to include the new endpoint
- Modify imports to include necessary utilities and remove unused references
2026-01-13 16:38:23 +01:00
hongwei
d32947ba06 refactor/Introduce http4s routes for v7.0.0 and update API resource docs
- Add `Http4sEndpoint` type alias and `http4sPartialFunction` in APIUtil for handling http4s routes
- Refactor Http4s700 to define routes as standalone functions (e.g., `root`, `getBanks`) within Implementations7_0_0 object
- Attach resource documentation to each route for better maintainability
- Create a unified `allRoutes` combining v7.0.0 route handlers
- Update imports and clean up unused references
2026-01-13 16:38:23 +01:00