Commit 06088df · Reviewed 2026-03-18 · Reviewer: architect-agent
All queries target the oid schema only. No cross-schema references detected.
No direct HTTP calls to other ODS services. All communication via Redpanda CloudEvents (6 event types).
RLS policies defined but never activated (app.tenant_id never set). tenant_id accepted from request body in mutation endpoints instead of JWT.
All required directories present: domain/, repository/, api/, events/. Extra service/ layer is acceptable.
No hardcoded ODS service URLs. JWT_ISSUER configurable via env var with default fallback.
N/A — service makes no outbound HTTP calls. Communication is event-only via Redpanda.
Full CloudEvents v1.0 compliance. All required fields present including tenantid extension and correlationid.
Zero unwrap() in production code. Custom OidError enum. Correlation IDs in event logs.
| Severity | File | Issue |
|---|---|---|
| CRITICAL | src/repository/user_repo.rs src/repository/client_repo.rs (all repos) |
app.tenant_id PostgreSQL session variable is never set before executing queries. All RLS policies use current_setting('app.tenant_id', true)::UUID as the filter, making them completely inactive. Tenant data isolation is enforced only at the application layer with no database-level guarantee. |
| HIGH | src/api/users.rs:69 create_user handler |
Handler does not use AuthenticatedUser extractor. tenant_id is accepted directly from the JSON request body with no JWT authentication. Any caller can create users in any tenant. |
| HIGH | src/api/roles.rs:48 create_role handler |
Handler does not use AuthenticatedUser extractor. tenant_id accepted from request body without JWT enforcement. |
| HIGH | src/api/clients.rs:92 create_client handler |
Handler does not use AuthenticatedUser extractor. tenant_id accepted from request body without JWT enforcement. |
Service is NON-COMPLIANT. Two categories of multi-tenancy violations must be resolved before promotion:
SET LOCAL app.tenant_id = $tenant_id inside every database transaction (or use a connection wrapper/middleware). Without this, all RLS policies are dormant and data isolation depends solely on application-level filtering.AuthenticatedUser extractor to create_user, create_role, and create_client handlers. Extract tenant_id from user.tenant_id (JWT claims) instead of the request body.