Class BowireAuditLog
- Namespace
- Kuestenlogik.Bowire.Auth
- Assembly
- Kuestenlogik.Bowire.dll
One line per action taken on somebody else's behalf (#98).
public sealed class BowireAuditLog
- Inheritance
-
BowireAuditLog
- Inherited Members
Remarks
Impersonation is the one place in Bowire where the person doing something and the person it happens to are different people. Everything else in the product can be reconstructed from its own state; this cannot — once an administrator has acted as somebody, the resulting recording looks exactly like one that person made themselves.
So the log is append-only and names both identities on every line. It is not a general request log: writing every read would bury the handful of lines that matter under a day of noise, and a log nobody can read is not an audit trail. Only the start, the end, and the requests that changed something are recorded.
Constructors
BowireAuditLog(string, TimeProvider?)
A log under storageRoot.
public BowireAuditLog(string storageRoot, TimeProvider? clock = null)
Parameters
storageRootstringThe data root.
clockTimeProviderInjected in tests so timestamps are predictable.
Fields
DirectoryName
The directory under the storage root that holds the log.
public const string DirectoryName = "audit"
Field Value
Properties
Directory
Where the log is kept.
public string Directory { get; }
Property Value
File
The log itself.
public string File { get; }
Property Value
Methods
Lines()
Every line in the log, oldest first. For tests and operators.
public IReadOnlyList<string> Lines()
Returns
Record(string, string, string, string?)
Record one action.
public void Record(string action, string actor, string actingAs, string? detail = null)