FakeAuditLog class final

The audit rows of the fake in ascending seq, each an AuditEvent as JSON.

Example:

final log = server.audit;
log.add(world, action: 'grant.create', actor: alex.id);
log.tamper(1); // the check now reports seq 1 as broken

Constructors

FakeAuditLog()

Properties

hashCode → int
The hash code for this object.
no setterinherited
lastCheckpointSeq ↔ int?
The seq of the last checkpoint, or null without one; a check without a range starts after it (M1-50).
getter/setter pair
nextCorrelationId → String
A correlation ID for the rows of one request, in the shape of CorrelationId: the ID the next row would get on its own, so it never repeats the ID of an earlier row (10 11 point 4: every audit row of one request carries the same correlation_id).
no setter
rows → List<JsonMap>
The rows in ascending seq.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
warnings → List<String>
The warnings of every check, for example checkpoint_sink_not_configured.
final

Methods

add(FakeWorld world, {required String action, String decision = 'allow', String? actor, String? denyReason, String? resourceKind, String? resourceId, JsonMap details = const {}, DateTime? at, String? correlationId}) → JsonMap
Appends a row and returns it; the hash links it to the row before.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tamper(int seq) → void
Changes the details of the row seq without its hash, so the chain breaks there.
toString() → String
A string representation of this object.
inherited
verify({int? fromSeq, int? toSeq}) → FakeAuditCheck
Checks the rows fromSeq to toSeq (both inclusive); without fromSeq it starts after lastCheckpointSeq (or at 1), without toSeq it ends at the last row.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

hashOf(JsonMap row) → String
The hash of row: SHA-256 over its fields without hash, in a fixed key order, after its prev_hash.