Skip to main content

AuditRecord

Struct AuditRecord 

Source
pub struct AuditRecord {
    pub event: AuditEvent,
    pub profile: String,
    pub actor: Actor,
    pub account_id: Option<String>,
    pub order_id: Option<String>,
    pub cert_serial: Option<String>,
    pub identifiers: Vec<String>,
    pub client: ClientContext,
    pub reason: Option<String>,
    pub detail: Option<String>,
}
Expand description

One row, before it is written.

Built with AuditRecord::new plus the with_* setters rather than a struct literal: the four events populate different subsets — an issuance failure has no serial, an accountless revocation has no account — and a literal would mean a column of Nones at every call site.

Fields§

§event: AuditEvent§profile: String§actor: Actor§account_id: Option<String>§order_id: Option<String>§cert_serial: Option<String>§identifiers: Vec<String>§client: ClientContext§reason: Option<String>§detail: Option<String>

Implementations§

Source§

impl AuditRecord

Source

pub fn new(event: AuditEvent, profile: impl Into<String>, actor: Actor) -> Self

A record of event at profile, by actor, with every optional field empty; the with_* builders fill them in.

Source

pub fn admin(event: AuditEvent, actor: Actor) -> Self

A record for an administrative action that is not scoped to one ACME endpoint — an operator, a session, the nonce table, the audit log itself. profile is stored empty (the column stays NOT NULL; "" reads as “no profile”), and the acting identity is Actor plus whatever AuditRecord::with_detail carries. Account, EAB and order actions keep AuditRecord::new with their real profile.

Source

pub fn with_order( self, order_id: Uuid, account_id: Uuid, identifiers: &[Identifier], ) -> Self

Fills in the subject from an order: its id, its account and the names it covers, the last frozen into the row rather than joined back — the order may be deleted long before the row is read.

Takes the three fields rather than the stored order, which is a row of the storage layer this vocabulary sits below.

Source

pub fn with_account(self, account_id: impl Into<String>) -> Self

The account the row is about.

Source

pub fn with_serial(self, serial: impl Into<String>) -> Self

The certificate serial, lowercase unseparated hex.

Source

pub fn with_client(self, client: ClientContext) -> Self

Where the request came from: address, reverse name, User-Agent and request id.

Source

pub fn with_reason(self, reason: impl Into<String>) -> Self

The RFC 8555 problem type on a refusal, or the RFC 5280 reason code on a revocation. Never both — see the column comment in the migration.

Source

pub fn with_detail(self, detail: impl Into<String>) -> Self

Free text for a human reading the trail. Never parsed.

Trait Implementations§

Source§

impl Clone for AuditRecord

Source§

fn clone(&self) -> Self

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 AuditRecord

Source§

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

Formats the value using the given formatter. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
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.

Source§

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

Source§

fn from_ref(input: &T) -> T

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

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

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

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

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> WithSubscriber for T

Source§

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

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

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