pub struct AuditRecord {
pub ts_unix_ms: u64,
pub request_id: Uuid,
pub actor: AuditActor,
pub action: AuditAction,
pub resource: AuditResource,
pub outcome: AuditOutcome,
pub latency_ms: u64,
pub peer_addr: Option<String>,
pub client_cert_subject: Option<String>,
}Expand description
Top-level audit record emitted once per state-mutating HTTP call.
Every field is serialised in a stable shape; see the module docs and
docs/AUDIT-LOG.md for the wire-format contract.
Fields§
§ts_unix_ms: u64Millisecond-precision Unix timestamp when the request completed (i.e. when the audit record was synthesised).
request_id: UuidUnique identifier for this request. Generated by the audit middleware on entry and inserted into the request extensions so handlers can correlate logs against the audit trail.
actor: AuditActorWho issued the request.
action: AuditActionWhat they tried to do.
resource: AuditResourceWhat they tried to do it to.
outcome: AuditOutcomeWhat happened.
latency_ms: u64End-to-end handler latency, in milliseconds. Includes all
middleware that ran after audit_log_middleware.
peer_addr: Option<String>Caller’s peer socket address as observed by the listener, if the
router was bound with axum::extract::connect_info::IntoMakeServiceWithConnectInfo.
None in tests (which drive the router via oneshot) and in
proxy-fronted deployments that strip the connection.
client_cert_subject: Option<String>Client-certificate Subject DN as recovered from the
X-Forwarded-Client-Cert header (Envoy XFCC format). Populated
only when the reverse-proxy mTLS path described in
docs/deployment/mtls.md (W2.8) is in front of the gateway and
the request reached us with the header set.
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 moreSource§impl Debug for AuditRecord
impl Debug for AuditRecord
Auto Trait Implementations§
impl Freeze for AuditRecord
impl RefUnwindSafe for AuditRecord
impl Send for AuditRecord
impl Sync for AuditRecord
impl Unpin for AuditRecord
impl UnsafeUnpin for AuditRecord
impl UnwindSafe for AuditRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more