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
auth: Cow<'a, AuthContext>
AssetAccess
A request that asks if an asset may be accessed has been received.
Fields
auth: Cow<'a, AuthContext>
WorkflowValidate
A request that asks if a workflow is permitted has been received.
Fields
auth: Cow<'a, AuthContext>
ReasonerResponse
Logs the raw response of a reasoner.
ReasonerVerdict
Logs the official response of a reasoner.
ReasonerContext
Logs the reasoner backend for during startup.
PolicyAdd
Logs the arrival of a new policy.
PolicyActivate
Logs the activation of an existing policy.
PolicyDeactivate
Logs the deactivation of the current active policy.
Fields
auth: Cow<'a, AuthContext>
Implementations§
Source§impl<'a> LogStatement<'a>
impl<'a> LogStatement<'a>
Sourcepub fn execute_task(
reference: &'a str,
auth: &'a AuthContext,
policy: i64,
state: &'a State,
workflow: &'a Workflow,
task: &'a str,
) -> Self
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
: TheAuthContext
that explains who performed the request.policy
: ThePolicy
used to evaluate the request.state
: TheState
given to the policy for evaluation.workflow
: TheWorkflow
that is being evaluated.task
: Which task in theworkflow
we’re specifically considering.
§Returns
A new LogStatement::ExecuteTask
that is initialized with the given properties.
Sourcepub 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
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
: TheAuthContext
that explains who performed the request.policy
: ThePolicy
used to evaluate the request.state
: TheState
given to the policy for evaluation.workflow
: TheWorkflow
that is being evaluated.task
: Which task in theworkflow
we’re specifically considering.
§Returns
A new LogStatement::AssetAccess
that is initialized with the given properties.
Sourcepub fn workflow_validate(
reference: &'a str,
auth: &'a AuthContext,
policy: i64,
state: &'a State,
workflow: &'a Workflow,
) -> Self
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
: TheAuthContext
that explains who performed the request.policy
: ThePolicy
used to evaluate the request.state
: TheState
given to the policy for evaluation.workflow
: TheWorkflow
that is being evaluated.task
: Which task in theworkflow
we’re specifically considering.
§Returns
A new LogStatement::WorkflowValidate
that is initialized with the given properties.
Sourcepub fn reasoner_response(reference: &'a str, response: &'a str) -> Self
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.
Sourcepub fn reasoner_verdict(reference: &'a str, verdict: &'a Verdict) -> Self
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.
Sourcepub fn reasoner_context<C: ConnectorWithContext>() -> Self
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.
Sourcepub fn policy_add<C: ConnectorWithContext>(
auth: &'a AuthContext,
policy: &'a Policy,
) -> Self
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
: TheAuthContext
that explains who performed the request.context
: The context that is used to give answers with this reasoner.policy
: ThePolicy
added to the checker in this request.
§Returns
A new LogStatement::ReasonerContext
that is initialized with the given properties.
Sourcepub fn policy_activate(auth: &'a AuthContext, policy: &'a Policy) -> Self
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
: TheAuthContext
that explains who performed the request.policy
: ThePolicy
that got activated in this request.
§Returns
A new LogStatement::PolicyActivate
that is initialized with the given properties.
Sourcepub fn policy_deactivate(auth: &'a AuthContext) -> Self
pub fn policy_deactivate(auth: &'a AuthContext) -> Self
Constructor for a LogStatement::PolicyDeactivate
that makes it a bit more convenient to initialize.
§Arguments
auth
: TheAuthContext
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>
impl<'a> Clone for LogStatement<'a>
Source§fn clone(&self) -> LogStatement<'a>
fn clone(&self) -> LogStatement<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> Debug for LogStatement<'a>
impl<'a> Debug for LogStatement<'a>
Source§impl<'de, 'a> Deserialize<'de> for LogStatement<'a>
impl<'de, 'a> Deserialize<'de> for LogStatement<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a> EnumDebug for LogStatement<'a>
impl<'a> EnumDebug for LogStatement<'a>
Source§fn type_name() -> &'static str
fn type_name() -> &'static str
Source§fn variant_names() -> &'static [&'static str]
fn variant_names() -> &'static [&'static str]
Source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Source§fn variant(&self) -> EnumDebugFormatter<'_, Self>
fn variant(&self) -> EnumDebugFormatter<'_, Self>
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> 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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request