sergehuber opened a new pull request, #811:
URL: https://github.com/apache/unomi/pull/811
## Plain-language summary
Multi-tenant operators could not see how much each customer was using Unomi
(profiles, events, storage, and similar). Plan limits belong in the layer above
Unomi, but that layer needs a supported way to **read** usage per tenant.
This change adds a read-only usage API on the tenant REST endpoints. It also
removes old quota code that suggested Unomi enforced limits when it did not.
Tenant admins can read their own tenant; platform admins can read any tenant.
## What changed
* Add `GET /cxs/tenants/{tenantId}/usage` with optional `period` (currently
`24h` label for snapshot metrics).
* Introduce `TenantUsageService` and `TenantUsage` DTO; replace
`TenantMonitoringService` and `TenantQuotaService`.
* Remove unreleased `ResourceQuota` on `Tenant` (misleading; not enforced).
* Record in-memory REST request counts per tenant after successful auth
(observability only).
* Harden tenant REST security: `@RequiresTenant` on tenant-scoped routes,
class/method role resolution in `SecurityFilter`.
* Fix `KarafSecurityService.clearCurrentSubject()` to clear the request
subject correctly.
* Update multitenancy manual and shell tenant CRUD; extend `TenantIT` with
usage endpoint coverage.
## Test plan
- [x] `mvn -pl services test -Dtest=TenantUsageServiceImplTest`
- [x] `mvn -pl rest test -Dtest=SecurityFilterTest`
- [x] `mvn -pl services-common test -Dtest=KarafSecurityServiceTest`
- [x] `mvn -pl api,services,rest,services-common -am test-compile`
- [ ] CI integration tests (`TenantIT.testTenantUsageEndpoint`)
## References
UNOMI-958
--
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]