sergehuber opened a new pull request, #823: URL: https://github.com/apache/unomi/pull/823
## Plain-language summary Unomi 3.1 release validation found several REST API problems. In V2 compatibility mode, Karaf admin users could not call some private endpoints such as `/cxs/privacy/info`, which broke health checks and migration tooling. Other endpoints returned server errors (HTTP 500) when a resource was simply missing, or when export configuration was incomplete. This PR fixes those server-side issues so clients get correct HTTP status codes and clear errors. V3 authentication behavior outside V2 compat mode is unchanged. ## What changed * **V2 compat auth:** Karaf admin on private endpoints gets the tenant admin roles needed for persistence operations (e.g. `AGGREGATE` on `/cxs/privacy/info`). Integration test added in `V2CompatibilityModeIT`. * **Missing resources → 404:** Value types, goals, goal reports, and events return HTTP 404 when the id does not exist (REST layer + goal report null guard in service). * **Export hardening:** Profile CSV export handles missing segment metadata without NPE; router export validates segment and mapping before processing. * **OpenSearch parity:** Property conditions with null/missing values throw `IllegalArgumentException`, matching Elasticsearch behavior. * **Blueprint:** Inject `contextManager` into `UserListServiceImpl`. * **Logging:** Duplicate property mapping messages downgraded from WARN to DEBUG on ES/OS persistence. * **Unit tests:** `MissingResourceEndpointsTest`, `GoalsServiceImplTest`, `ProfileServiceImplTest`, `ProfileExportServiceImplTest`, `PropertyConditionOSQueryBuilderTest`. ## Test plan - [x] `V2CompatibilityModeIT` — includes `GET /cxs/privacy/info` under V2 compat - [x] `MissingResourceEndpointsTest` (REST unit) - [x] `GoalsServiceImplTest#testGetGoalReportMissingGoalReturnsNull` - [x] `ProfileServiceImplTest#testExportProfilesPropertiesToCsv_missingSegmentDefinition_usesSegmentId` - [x] `ProfileExportServiceImplTest` - [x] `PropertyConditionOSQueryBuilderTest` - [ ] `mvn clean install -P integration-tests` on CI - [ ] Rebuild Unomi Docker image and run `unomi-rest-api-tests` on 3.1-es, 3.1-os, 3.1-es-v2compat stacks ## References [UNOMI-962](https://issues.apache.org/jira/browse/UNOMI-962), [UNOMI-875](https://issues.apache.org/jira/browse/UNOMI-875), [UNOMI-904](https://issues.apache.org/jira/browse/UNOMI-904) _Supersedes closed PR #822 (branch renamed to `fix/UNOMI-962-rest-api-hardening`)._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
