pub struct AuditEntry {
pub seq: u64,
pub at_unix_ms: i64,
pub method: String,
pub principal: String,
pub fingerprint: String,
pub scope: String,
pub level: String,
pub auth_mode: String,
pub decision: String,
pub reason: String,
pub prev: String,
pub hash: String,
}Expand description
One entry, as it sits on disk.
Field order is the serialisation order and the hashing order. It is
deny_unknown_fields so a file written by a newer gunnar is refused loudly
rather than verified against fields this build cannot see.
Fields§
§seq: u640 for the first entry, then +1 each time. Redundant with the file’s line numbering on purpose: a chain whose only ordering was its line order could be truncated to a shorter, still-valid chain without the entries themselves saying anything was missing.
at_unix_ms: i64When the decision was made.
method: StringService.Method.
principal: StringThe ACL principal id.
fingerprint: StringThe key fingerprint.
scope: StringThe scope asked about.
level: StringThe grant level.
auth_mode: StringThe authentication mode the listener was in.
decision: Stringallow, deny, narrow.
reason: StringWhy, or empty.
prev: StringThe previous entry’s AuditEntry::hash, or GENESIS.
hash: StringThis entry’s own hash. Not hashed into itself; see AuditEntry::compute_hash.
Implementations§
Source§impl AuditEntry
impl AuditEntry
Sourcepub fn compute_hash(&self) -> String
pub fn compute_hash(&self) -> String
The hash this entry should carry, computed from everything else in it.
Verification is entry.hash == entry.compute_hash() plus
entry.prev == previous.hash. Both halves are needed: the first catches
an edited field, the second catches a removed, reordered or inserted
entry.