Table of Contents

Class AuditEntry

Namespace
Tharga.Team.Service.Audit
Assembly
Tharga.Team.Service.dll

Represents a single audit log entry. Immutable record created by the audit infrastructure.

public record AuditEntry : IEquatable<AuditEntry>
Inheritance
AuditEntry
Implements
Inherited Members

Properties

AccessLevel

public string AccessLevel { get; init; }

Property Value

string

Action

public string Action { get; init; }

Property Value

string

CallerIdentity

public string CallerIdentity { get; init; }

Property Value

string

CallerKeyId

Stable identifier of the API key that authenticated this caller (the IApiKey.Key Guid string). Null when the caller did not authenticate via an API key.

public string CallerKeyId { get; init; }

Property Value

string

CallerSource

public AuditCallerSource CallerSource { get; init; }

Property Value

AuditCallerSource

CallerType

public AuditCallerType CallerType { get; init; }

Property Value

AuditCallerType

CallerUserIdentity

The authentication subject of the user who acted (Identity), or null for an API key, a background actor, or an unknown caller.

public string CallerUserIdentity { get; init; }

Property Value

string

Remarks

CallerIdentity is a display string resolved through a fallback chain — name claim, then preferred_username, then subject — so its content depends on which claims the identity provider emits, and a filter matching it has to do so by substring. This is always the subject or nothing, which makes an exact match possible. Same reasoning as CallerKeyId, which exists because a key's display name was "human-friendly but not unique".

CorrelationId

public Guid CorrelationId { get; init; }

Property Value

Guid

DurationMs

public long DurationMs { get; init; }

Property Value

long

ErrorMessage

public string ErrorMessage { get; init; }

Property Value

string

EventType

public required AuditEventType EventType { get; init; }

Property Value

AuditEventType

Feature

public string Feature { get; init; }

Property Value

string

Metadata

public Dictionary<string, string> Metadata { get; init; }

Property Value

Dictionary<string, string>

MethodName

public string MethodName { get; init; }

Property Value

string

ScopeChecked

public string ScopeChecked { get; init; }

Property Value

string

ScopeResult

public AuditScopeResult ScopeResult { get; init; }

Property Value

AuditScopeResult

Success

public bool Success { get; init; }

Property Value

bool

TeamKey

public string TeamKey { get; init; }

Property Value

string

Timestamp

public required DateTime Timestamp { get; init; }

Property Value

DateTime

Methods

ParseScope(string)

Parses a scope string "feature:action" into Feature and Action components.

public static (string Feature, string Action) ParseScope(string scope)

Parameters

scope string

Returns

(string Feature, string Action)