pub struct AuditLog { /* private fields */ }Expand description
A node’s append-only access log.
Implementations§
Source§impl AuditLog
impl AuditLog
pub fn new() -> Self
Sourcepub fn from_entries(entries: Vec<AuditEntry>) -> Self
pub fn from_entries(entries: Vec<AuditEntry>) -> Self
Reconstruct a log from persisted entries (then verify).
pub fn entries(&self) -> &[AuditEntry]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn record(
&mut self,
node: &Identity,
at_unix: u64,
bearer: &Did,
scope: &Scope,
op: Ops,
capability_id: Option<[u8; 16]>,
decision: AuditDecision,
) -> AuditResult<()>
pub fn record( &mut self, node: &Identity, at_unix: u64, bearer: &Did, scope: &Scope, op: Ops, capability_id: Option<[u8; 16]>, decision: AuditDecision, ) -> AuditResult<()>
Append a signed, chained record of one access decision.
Sourcepub fn verify(&self, node_public_key: &[u8]) -> AuditResult<()>
pub fn verify(&self, node_public_key: &[u8]) -> AuditResult<()>
Re-walk the chain: sequence, prev-hash links, content hashes, and each
node signature against node_public_key. Any inconsistency is an error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuditLog
impl RefUnwindSafe for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
impl UnwindSafe for AuditLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more