pub struct AuditEvent {
pub ts: u128,
pub event_id: String,
pub principal: Option<String>,
pub source: AuditAuthSource,
pub tenant: Option<String>,
pub action: String,
pub resource: Option<String>,
pub outcome: Outcome,
pub detail: Value,
pub remote_addr: Option<String>,
pub correlation_id: Option<String>,
}Expand description
Structured audit event. Serialised as one JSONL row per call.
Fields§
§ts: u128§event_id: String§principal: Option<String>§source: AuditAuthSource§tenant: Option<String>§action: String§resource: Option<String>§outcome: Outcome§detail: Value§remote_addr: Option<String>§correlation_id: Option<String>Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn builder(action: impl Into<String>) -> AuditEventBuilder
pub fn builder(action: impl Into<String>) -> AuditEventBuilder
Convenience builder. The caller fills the required fields and chains the optional ones — keeps emit sites readable.
Sourcepub fn from_legacy(
action: &str,
principal: &str,
target: &str,
result: &str,
details: JsonValue,
) -> Self
pub fn from_legacy( action: &str, principal: &str, target: &str, result: &str, details: JsonValue, ) -> Self
Wrap a pre-structured-API call into the new schema. Used by the
back-compat record(action, principal, target, result, details)
path so existing emit sites keep compiling.
Sourcepub fn to_json_line(&self, prev_hash: Option<&str>) -> String
pub fn to_json_line(&self, prev_hash: Option<&str>) -> String
Render to a single JSONL line, optionally seeded with a
prev_hash for the tamper-evident chain.
Sourcepub fn parse_line(line: &str) -> Option<Self>
pub fn parse_line(line: &str) -> Option<Self>
Parse one JSONL line back into an AuditEvent. Returns None
for legacy lines (pre-restructuring) or malformed JSON; callers
in the query path use this to filter.
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Auto Trait Implementations§
impl Forget for AuditEvent
impl Freeze for AuditEventwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnsafeUnpin for AuditEventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for AuditEvent
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request