Skip to main content

Module audit_log_details

Module audit_log_details 

Source
Expand description

Reshape proto audit_log_event_v1::Details JSON back into the shape mz_audit_log::EventDetails::as_json produces.

The mz_audit_events MV reads audit events from mz_catalog_raw as their durable proto twin (mz_catalog_protos::objects::audit_log_event_v1) and projects details through the SQL scalar parse_catalog_audit_log_details. Its output must equal what the prior pack_audit_log_update populator wrote, i.e. mz_audit_log::EventDetails::as_json.

The reshape is driven by five rule tables below plus two structural rewrites (StringWrapper unwrap and the ResetAllV1 null case). See the individual table docstrings for their shapes. The reciprocal is EventDetails::as_json combined with the proto RustType conversion in src/catalog-protos/src/audit_log.rs. The round-trip property test at src/catalog/tests/audit_log_details.rs samples every Arbitrary variant and catches drift when either side gains a new variant, field, or serde attribute.

Structs§

ParseCatalogAuditLogDetails

Functions§

parse_catalog_audit_log_details 🔒
Reshapes proto audit_log_event_v1::Details JSON from mz_catalog_raw (e.g. {"IdFullNameV1": {"id": "u1", "name": {...}}}) into the shape mz_audit_log::EventDetails::as_json produces: the format the prior pack_audit_log_update populator wrote to mz_audit_events.