Skip to main content

AuditEvent

Struct AuditEvent 

Source
pub struct AuditEvent {
Show 17 fields pub schema_version: u32, pub event_id: String, pub timestamp: String, pub kind: EventKind, pub action: String, pub summary: String, pub actor: Actor, pub client: Client, pub site: Option<String>, pub request: Request, pub outcome: Outcome, pub dry_run: Option<bool>, pub targets: BTreeMap<String, Vec<String>>, pub nodes: Vec<String>, pub produced: BTreeMap<String, String>, pub details: Map<String, Value>, pub emitter: Emitter,
}
Expand description

One audit record. See the module docs for the stability contract.

Fields§

§schema_version: u32§event_id: String

Random v4 UUID; also the Kafka message key.

§timestamp: String

RFC 3339 UTC timestamp (millisecond precision) of emission.

§kind: EventKind

What kind of activity this is.

§action: String

Stable operation name chosen by the handler, e.g. group.delete; "<METHOD> <route>" when the handler did not name it (e.g. the request was rejected before the handler ran).

§summary: String

One human-readable line saying who did what, where, and how it ended — see AuditEvent::describe. Derived from the other fields when the event is emitted; for reading, not for parsing.

§actor: Actor

Who did it.

§client: Client

From where.

§site: Option<String>

Target site (X-Manta-Site), when supplied.

§request: Request

The request as received.

§outcome: Outcome

How it ended.

§dry_run: Option<bool>

true when the caller asked for a dry run (nothing changed), false for a real run of an operation that has a dry-run mode; absent when the operation has none or the handler never ran.

§targets: BTreeMap<String, Vec<String>>

Objects the operation acts on, keyed by object kind (group, node, hosts, image, …). Values are as the caller supplied them (a hosts expression is not expanded; see Self::nodes), except where the caller selected by pattern: configuration.delete records the configurations, sessions, templates and images it matched.

§nodes: Vec<String>

Concrete node xnames the server resolved the request to, when it expanded a hosts expression or a group itself (power, boot, kernel parameters, runtime configuration, migrate). Power, boot and kernel parameters record it before the operation runs, so it is present on dry runs and failures too; runtime configuration and migrate resolve and apply in one service call, so there it is recorded only once that call succeeds.

§produced: BTreeMap<String, String>

What the operation created or started, by kind (transition, session, configuration, image, hostname) — the ids to look the operation up by in the backend. Only on success, never on a dry run.

§details: Map<String, Value>

Further operation parameters a handler chose to record (e.g. force, the power action, the kernel parameters).

§emitter: Emitter

Which server emitted it.

Implementations§

Source§

impl AuditEvent

Source

pub fn describe(&self) -> String

One line for humans, built from the structured fields:

rjanalik @ alps: power off nid001288 (1 node, force) → success, transition 4c1e…
alice @ alps: image delete a b (dry run) → success
anonymous: DELETE /v2/groups/zinal → denied (401)

Control characters are escaped (\n → \\n): the line is logged as plain text and its values are caller-controlled.

Every route gets one with no per-handler code: the verb is the handler’s action with its separators turned into spaces, or method and path when no handler named it.

Trait Implementations§

Source§

impl Clone for AuditEvent

Source§

fn clone(&self) -> AuditEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AuditEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for AuditEvent

Source§

fn eq(&self, other: &AuditEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AuditEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AuditEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more