log_audit() now returns AppResult<()> and all callers use ? — audit failures abort mutations instead of being silently swallowed. Enforced by the type system; a regression to () would fail to compile.
storage_key excluded from all API responses (create, get, list, update). Information disclosure fix — internal storage paths no longer leak to clients.
validate_metadata() enforces depth ≤ 5 and keys ≤ 50, called in both domain validation and service layer on create and update paths.
docstore PostgreSQL schema. begin_tenant_tx() issues SET LOCAL search_path TO docstore, public on every transaction. No references to oid, pdf, workflow, or any other service schema detected in production code.reqwest is in [dev-dependencies] only — unavailable to production binaries. All state changes propagated via Redpanda CloudEvents on topic events.docstore using rdkafka.tenant_id extracted from JWT claims only (RS256, issuer+audience+exp+nbf validated). RLS enabled on all 6 tables via app.current_tenant_id set per transaction. CloudEvents include tenantid extension attribute.domain/, repository/, api/, service/, events/. Domain layer has zero imports from repository or api. API handlers delegate all business logic to service layer — pure HTTP routing.AppConfig::from_env(). OID_ISSUER, OID_PUBLIC_KEY, and DATABASE_URL are required with no defaults. URL literals (*.example.com, *.test.internal) appear only in #[cfg(test)] blocks.X-Correlation-Id is extracted from requests, generated as UUID v4 if absent, stored in AuthContext, and propagated to service layer and audit entries.specversion ("1.0"), type (via #[serde(rename = "type")] on event_type), source ("/ods/docstore"), id (UUID v4), time (RFC 3339), tenantid extension, datacontenttype, data. Verified by integration test..unwrap() in production code — all in #[cfg(test)] blocks. thiserror-based AppError masks internals from clients. Audit propagation improved this commit (AppResult<()> + ?). Two WARNs remain open: .expect() at startup; no X-Correlation-Id in error response JSON.Ctrl/Cmd + wheel to zoom — drag to pan — double-click to fit — click ⛶ to open full size
| Severity | Rule | File | Line | Description |
|---|---|---|---|---|
| WARN | Error Handling | src/events/producer.rs |
51 |
.expect("Failed to create Kafka producer") in EventProducer::new()
Panics if broker config is invalid at startup. Suggest returning Result<Self, rdkafka::error::KafkaError> to enable graceful startup error handling and unit testing. Carried from 15e9eb5.
|
| WARN | Error Handling | src/error.rs |
44 |
error_response() JSON body does not include X-Correlation-Id
Clients cannot correlate failed requests with server-side logs. Suggest adding correlation_id to error JSON or injecting it via Actix-web middleware that reads it from request context. Carried from 15e9eb5.
|