pub struct AuditRecord {Show 16 fields
pub timestamp: DateTime<Utc>,
pub kind: AuditRecordKind,
pub originator: Option<UserId>,
pub session_id: Option<SessionId>,
pub invocation_chain: Vec<Principal>,
pub roles: Vec<RoleName>,
pub method: MethodPath,
pub scope_required: Vec<Scope>,
pub decision: AuditDecision,
pub latency_us: u64,
pub origin: Option<Origin>,
pub client_ip: Option<IpAddr>,
pub correlation_id: Uuid,
pub policy_name: Option<ForwardPolicyName>,
pub derivation: Option<ForwardDerivation>,
pub caller_ns: Option<String>,
}Expand description
One audit observation: a scope check or a forward-policy application.
Shape is pinned by:
- AUTHZ-S01-output §1: base fields (
timestamp,roles,method,scope_required,decision,latency_us,origin,client_ip,correlation_id). - AUTHZ-S01-output §“AUTHZ-0 ratification revisions” §2: typed
originator: Option<UserId>,session_id: Option<SessionId>, and the forensicinvocation_chain: Vec<Principal>for confused-deputy reconstruction. - AUTHLANG-S01-output §4: the
kinddiscriminant (defaultScopeCheckfor serde) plus three optional fields populated only byForwardPolicyAppliedrecords:policy_name,derivation,caller_ns.
§Defaults
kind defaults to AuditRecordKind::ScopeCheck when omitted from a
deserialize payload — existing AUTHZ-side producers don’t need to set it.
policy_name, derivation, caller_ns default to None — they are
populated only by AUTHLANG-3’s forward-policy producer.
§Sealing
Not sealed. The record is observational; constructibility is the point. See module-level docs.
Fields§
§timestamp: DateTime<Utc>When the check ran (UTC).
kind: AuditRecordKindWhich kind of record this is — drives field-presence expectations.
Defaults to ScopeCheck for legacy / AUTHZ-side producers that omit
the field on deserialize.
originator: Option<UserId>IdP-verified originator (the sub claim). None for anonymous /
unauthenticated checks.
session_id: Option<SessionId>IdP-issued session ID. None for anonymous / sessionless checks.
invocation_chain: Vec<Principal>The chain of immediate-callers leading to this dispatch. Empty for a direct (originator-to-backend) call. Forensic reconstruction of confused-deputy escalations reads this field.
Deserialize routes via the crate-private mint paths
(Principal::*_sealed) — see the module-level comment on the
PrincipalWire types. The wire shape matches Principal’s derived
Serialize.
roles: Vec<RoleName>The roles the principal carried at decision time.
method: MethodPathThe method being invoked at decision time.
scope_required: Vec<Scope>The scope set required by method. Empty if no scope is gated.
decision: AuditDecisionAllow or Deny { reason }.
latency_us: u64Dispatch latency in microseconds.
origin: Option<Origin>The backend Origin (URL-shaped, per CLIENTS-S01).
client_ip: Option<IpAddr>Network-layer source IP, when knowable.
correlation_id: UuidPer-call correlation ID; ties this record to traces and metrics.
policy_name: Option<ForwardPolicyName>ForwardPolicyApplied only: name of the policy that ran.
ForwardPolicyName wraps &'static str per AUTHLANG-2; the
deserializer interns the JSON value into a 'static slot — see the
module-level deserialize_policy_name doc.
derivation: Option<ForwardDerivation>ForwardPolicyApplied only: the derivation the policy returned.
caller_ns: Option<String>ForwardPolicyApplied only: the calling activation namespace.
Trait Implementations§
Source§impl Clone for AuditRecord
impl Clone for AuditRecord
Source§fn clone(&self) -> AuditRecord
fn clone(&self) -> AuditRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more