Expand description
§Access Logger
Generic read-side audit logger. Where EventStore records writes with
AuditMetadata, AccessLogger records
reads of sensitive data — the other half of HIPAA §164.312(b) and the
equivalent obligations under GDPR, PCI-DSS, and SOC 2.
Reads do not go through the event store. Controllers must explicitly
invoke AccessLogger::log_access before returning data classified as
anything beyond Sensitivity::Public.
§Why generic, not PHI-specific
The mechanism is the same regardless of regime: log who looked at what,
when, and why. Sensitivity tags the regime so a downstream sink can
route PHI to a HIPAA-compliant store, PCI to a separate one, drop
Sensitivity::Public reads, and so on.
§Lifecycle
- A read controller resolves the actor (typically the JWT-bound aggregate UUID).
- Builds an
AccessedResourcedescribing what’s about to be returned. - Calls
logger.log_access(actor, resource, purpose).await. - Returns the data to the client.
Default implementations in tests and non-regulated apps use
NoOpAccessLogger which validates inputs but discards them. Real
deployments wire a JetStream- or DB-backed implementation (Step 3+).
Structs§
- Access
LogEntry - Single record produced for every successful
log_accesscall. - Accessed
Resource - Description of the resource being read.
- Identity
- Identity of the entity performing the read.
- NoOp
Access Logger - Validates inputs and discards the entry. Default for test apps and any deployment that has not yet wired a real sink.
Enums§
- Access
LogError - Errors emitted by
AccessLoggerimplementations. - Failure
Policy - What controllers should do when an
AccessLoggersink fails. - Purpose
OfUse - Reason the read happened. Maps to HIPAA “purpose of use” categories but is applicable to any regime.
- Sensitivity
- Sensitivity tag — selects which regulatory regime governs a resource.
Traits§
- Access
Logger - Sink for read-access audit events.