Expand description
The audit log for Tablo panels: an AuditEntry for each record every write of a panel
names, stored inside the write’s transaction, and the read-only AuditLog resource that
lists them.
It is built on Tablo’s public API alone: a CommitHook stores the
writes, an AuthHook stores what auth does, and AuditLog is an
ordinary Resource. PanelAuditExt registers them on a
Panel:
use tablo_audit::PanelAuditExt;
Panel::new("admin").audit_log(|log| log.policy(when(is_admin)));The Db registers AuditEntry: list it in the app’s
models!, as tablo::models!(Post, tablo::audit::AuditEntry).
Structs§
- Audit
Change - One field an
AuditEntrychanged: its name, its label in the writer’s locale, and its spelling before and after,Nonewhere it held nothing. - Audit
Entry - Shipped record of one thing a panel user did: who, on which panel and for which tenant, to which resource and record, and which fields it changed.
- Audit
Event - The app’s own event for the audit log of a panel with
audit_trail: a sign-in, an export, a payment, beside what the panel’s writes record. - Audit
Log - The read-only resource listing the
AuditEntryrows of its panel, newest first, at{prefix}/audit-log, or under the area that places it.audit_logregisters it.
Enums§
- Impersonation
Event - A start or a stop of acting as a user, as
AuditEntry::impersonationreads it. The entry’sactoris who acted; this names whom they acted as.
Traits§
- Panel
Audit Ext - The audit log’s registrations on a
Panel.
Functions§
- forget_
actor - Keeps what the user
user_iddid, but no longer who did it, for an account being erased: each entry they acted in names a deleted user, thetablo-audit-deleted-usermessage, in their place, and each auth entry done to their account, a sign-in or an impersonation of them, no longer holds their name. The entries’ events, records and fields stay, as does the account’s id, which names no one once the account is gone. A refused sign-in names no account and keeps the login it typed untilprunedeletes it. Run it through the transaction that deletes the account. - forget_
tenant - Deletes the entries filed under
tenant, for a tenant being erased, but those recording an impersonation: a start is filed under the actor’s tenant, and stays as the record of who reached which account untilprunedeletes it. Entries of panels that act for no tenant name none, and stay. - impersonations
- The entries that record an impersonation, started or stopped, for a resource’s
queryor a filter: - prune
- Deletes the
AuditEntryrows ofpanelolder thanage. Nothing else deletes them butforget_tenant; a job calls it on the schedule the app keeps its audit trail for.