Skip to main content

PanelAuditExt

Trait PanelAuditExt 

Source
pub trait PanelAuditExt {
    // Required methods
    fn audit_log(
        self,
        customize: impl FnOnce(ResourceDef<AuditLog>) -> ResourceDef<AuditLog> + Send + 'static,
    ) -> Self;
    fn audit_trail(self) -> Self;
}
Expand description

The audit log’s registrations on a Panel.

Required Methods§

Source

fn audit_log( self, customize: impl FnOnce(ResourceDef<AuditLog>) -> ResourceDef<AuditLog> + Send + 'static, ) -> Self

Keeps an AuditEntry for each record every write of the panel names, inside the write’s transaction, as audit_trail does, and lists them through the AuditLog resource at {prefix}/audit-log, with customize adjusting its def.

The log is denied to everyone until customize gives it a policy, and that policy allows reads only. A reader sees the entries of the resources whose list they may open, whatever row scope each resource’s own query keeps, so the log’s policy should be no wider than the narrowest of them.

Source

fn audit_trail(self) -> Self

Keeps an AuditEntry for each record every write of the panel names, inside the write’s transaction, and one for each AuthEvent of the panel, a sign-in or a change of credentials among them, without listing them: an Area group lists them with group.resource_with::<AuditLog>(..). Calling it again changes nothing.

A CSV export stores an entry too, with the number of rows it hands over, before the first byte leaves; an export whose entry fails to store is refused.

Each entry names the actor, the tenant they act for, the resource and record, and the fields the write changed, as a CommitHook reads them: a field marked #[columns(skip)], such as a password hash, is never stored. A write whose entry fails to store rolls back with it, and so does a sign-in or a change of credentials; a refused sign-in, a sign-out and a stop of impersonation go through unrecorded. A refused sign-in stores the login as it was typed. Mounting refuses a Db that does not register AuditEntry, and an AuditLog on a panel without the trail.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PanelAuditExt for Panel

Source§

fn audit_log( self, customize: impl FnOnce(ResourceDef<AuditLog>) -> ResourceDef<AuditLog> + Send + 'static, ) -> Self

Source§

fn audit_trail(self) -> Self

Implementors§