audit_logger

Enum LogStatement

Source
pub enum LogStatement<'a> {
    ExecuteTask {
        reference: Cow<'a, str>,
        auth: Cow<'a, AuthContext>,
        policy: i64,
        state: Cow<'a, State>,
        workflow: Cow<'a, Workflow>,
        task: Cow<'a, str>,
    },
    AssetAccess {
        reference: Cow<'a, str>,
        auth: Cow<'a, AuthContext>,
        policy: i64,
        state: Cow<'a, State>,
        workflow: Cow<'a, Workflow>,
        data: Cow<'a, str>,
        task: Option<Cow<'a, str>>,
    },
    WorkflowValidate {
        reference: Cow<'a, str>,
        auth: Cow<'a, AuthContext>,
        policy: i64,
        state: Cow<'a, State>,
        workflow: Cow<'a, Workflow>,
    },
    ReasonerResponse {
        reference: Cow<'a, str>,
        response: Cow<'a, str>,
    },
    ReasonerVerdict {
        reference: Cow<'a, str>,
        verdict: Cow<'a, Verdict>,
    },
    ReasonerContext {
        connector_context: Value,
        connector_context_hash: String,
    },
    PolicyAdd {
        auth: Cow<'a, AuthContext>,
        connector_context_hash: String,
        policy: Cow<'a, Policy>,
    },
    PolicyActivate {
        auth: Cow<'a, AuthContext>,
        policy: Cow<'a, Policy>,
    },
    PolicyDeactivate {
        auth: Cow<'a, AuthContext>,
    },
}
Expand description

Collects everything we might want to log in an AuditLogger.

TODO: Nicer to move this to the toplevel crate, logger.rs.

Variants§

§

ExecuteTask

A request that asks if a task may be executed has been received.

Fields

§reference: Cow<'a, str>
§auth: Cow<'a, AuthContext>
§policy: i64
§state: Cow<'a, State>
§workflow: Cow<'a, Workflow>
§task: Cow<'a, str>
§

AssetAccess

A request that asks if an asset may be accessed has been received.

Fields

§reference: Cow<'a, str>
§auth: Cow<'a, AuthContext>
§policy: i64
§state: Cow<'a, State>
§workflow: Cow<'a, Workflow>
§data: Cow<'a, str>
§task: Option<Cow<'a, str>>
§

WorkflowValidate

A request that asks if a workflow is permitted has been received.

Fields

§reference: Cow<'a, str>
§auth: Cow<'a, AuthContext>
§policy: i64
§state: Cow<'a, State>
§workflow: Cow<'a, Workflow>
§

ReasonerResponse

Logs the raw response of a reasoner.

Fields

§reference: Cow<'a, str>
§response: Cow<'a, str>
§

ReasonerVerdict

Logs the official response of a reasoner.

Fields

§reference: Cow<'a, str>
§verdict: Cow<'a, Verdict>
§

ReasonerContext

Logs the reasoner backend for during startup.

Fields

§connector_context: Value
§connector_context_hash: String
§

PolicyAdd

Logs the arrival of a new policy.

Fields

§auth: Cow<'a, AuthContext>
§connector_context_hash: String
§policy: Cow<'a, Policy>
§

PolicyActivate

Logs the activation of an existing policy.

Fields

§auth: Cow<'a, AuthContext>
§policy: Cow<'a, Policy>
§

PolicyDeactivate

Logs the deactivation of the current active policy.

Fields

§auth: Cow<'a, AuthContext>

Implementations§

Source§

impl<'a> LogStatement<'a>

Source

pub fn execute_task( reference: &'a str, auth: &'a AuthContext, policy: i64, state: &'a State, workflow: &'a Workflow, task: &'a str, ) -> Self

Constructor for a LogStatement::ExecuteTask that makes it a bit more convenient to initialize.

§Arguments
  • reference: The reference ID for this request.
  • auth: The AuthContext that explains who performed the request.
  • policy: The Policy used to evaluate the request.
  • state: The State given to the policy for evaluation.
  • workflow: The Workflow that is being evaluated.
  • task: Which task in the workflow we’re specifically considering.
§Returns

A new LogStatement::ExecuteTask that is initialized with the given properties.

Source

pub fn asset_access( reference: &'a str, auth: &'a AuthContext, policy: i64, state: &'a State, workflow: &'a Workflow, data: &'a str, task: &'a Option<String>, ) -> Self

Constructor for a LogStatement::AssetAccess that makes it a bit more convenient to initialize.

§Arguments
  • reference: The reference ID for this request.
  • auth: The AuthContext that explains who performed the request.
  • policy: The Policy used to evaluate the request.
  • state: The State given to the policy for evaluation.
  • workflow: The Workflow that is being evaluated.
  • task: Which task in the workflow we’re specifically considering.
§Returns

A new LogStatement::AssetAccess that is initialized with the given properties.

Source

pub fn workflow_validate( reference: &'a str, auth: &'a AuthContext, policy: i64, state: &'a State, workflow: &'a Workflow, ) -> Self

Constructor for a LogStatement::WorkflowValidate that makes it a bit more convenient to initialize.

§Arguments
  • reference: The reference ID for this request.
  • auth: The AuthContext that explains who performed the request.
  • policy: The Policy used to evaluate the request.
  • state: The State given to the policy for evaluation.
  • workflow: The Workflow that is being evaluated.
  • task: Which task in the workflow we’re specifically considering.
§Returns

A new LogStatement::WorkflowValidate that is initialized with the given properties.

Source

pub fn reasoner_response(reference: &'a str, response: &'a str) -> Self

Constructor for a LogStatement::ReasonerResponse that makes it a bit more convenient to initialize.

§Arguments
  • reference: The reference ID for this request.
  • response: The raw response as returned by the reasoner.
§Returns

A new LogStatement::ReasonerResponse that is initialized with the given properties.

Source

pub fn reasoner_verdict(reference: &'a str, verdict: &'a Verdict) -> Self

Constructor for a LogStatement::ReasonerVerdict that makes it a bit more convenient to initialize.

§Arguments
  • reference: The reference ID for this request.
  • verdict: The verdict given by the reasoner.
§Returns

A new LogStatement::ReasonerVerdict that is initialized with the given properties.

Source

pub fn reasoner_context<C: ConnectorWithContext>() -> Self

Constructor for a LogStatement::ReasonerContext that makes it a bit more convenient to initialize.

§Arguments
  • context: The context that is used to give answers with this reasoner.
§Returns

A new LogStatement::ReasonerContext that is initialized with the given properties.

Source

pub fn policy_add<C: ConnectorWithContext>( auth: &'a AuthContext, policy: &'a Policy, ) -> Self

Constructor for a LogStatement::PolicyAdd that makes it a bit more convenient to initialize.

§Arguments
  • auth: The AuthContext that explains who performed the request.
  • context: The context that is used to give answers with this reasoner.
  • policy: The Policy added to the checker in this request.
§Returns

A new LogStatement::ReasonerContext that is initialized with the given properties.

Source

pub fn policy_activate(auth: &'a AuthContext, policy: &'a Policy) -> Self

Constructor for a LogStatement::PolicyActivate that makes it a bit more convenient to initialize.

§Arguments
  • auth: The AuthContext that explains who performed the request.
  • policy: The Policy that got activated in this request.
§Returns

A new LogStatement::PolicyActivate that is initialized with the given properties.

Source

pub fn policy_deactivate(auth: &'a AuthContext) -> Self

Constructor for a LogStatement::PolicyDeactivate that makes it a bit more convenient to initialize.

§Arguments
  • auth: The AuthContext that explains who performed the request.
§Returns

A new LogStatement::PolicyDeactivate that is initialized with the given properties.

Trait Implementations§

Source§

impl<'a> Clone for LogStatement<'a>

Source§

fn clone(&self) -> LogStatement<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for LogStatement<'a>

Source§

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

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

impl<'de, 'a> Deserialize<'de> for LogStatement<'a>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a> EnumDebug for LogStatement<'a>

Source§

fn type_name() -> &'static str

Returns the static name of the type used for EnumDebug-printing. Read more
Source§

fn variant_names() -> &'static [&'static str]

Returns all variants in the trait as a list of names. Read more
Source§

fn variant_name(&self) -> &'static str

Returns the static name of the variant. Read more
Source§

fn variant(&self) -> EnumDebugFormatter<'_, Self>

Returns a formatter for this enum that writes its variant name. Read more
Source§

fn variants() -> Copied<Iter<'static, &'static str>>

Returns an iterator over all variants in this enum. Read more
Source§

impl<'a> Serialize for LogStatement<'a>

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

Auto Trait Implementations§

§

impl<'a> Freeze for LogStatement<'a>

§

impl<'a> RefUnwindSafe for LogStatement<'a>

§

impl<'a> Send for LogStatement<'a>

§

impl<'a> Sync for LogStatement<'a>

§

impl<'a> Unpin for LogStatement<'a>

§

impl<'a> UnwindSafe for LogStatement<'a>

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

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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<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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
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.
Source§

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

Source§

fn vzip(self) -> V

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T