pub trait SecurityCheck: Send + Sync {
// Required method
fn check(
&self,
caller: &str,
capability: &str,
context: &Value,
) -> CheckOutcome;
// Provided methods
fn audit(&self, _decision: AuditDecision<'_>) { ... }
fn audit_context<'a>(
&self,
_capability: &str,
context: &'a Value,
_cwd: &str,
) -> Cow<'a, Value> { ... }
fn check_with_cwd(
&self,
caller: &str,
capability: &str,
context: &Value,
_cwd: &str,
) -> CheckOutcome { ... }
fn recorder(&self) -> Option<&dyn DecisionRecorder> { ... }
fn explain(
&self,
_caller: &str,
_capability: &str,
_context: &Value,
_cwd: &str,
) -> Option<DecisionExplanation> { ... }
}Required Methods§
Provided Methods§
Sourcefn audit(&self, _decision: AuditDecision<'_>)
fn audit(&self, _decision: AuditDecision<'_>)
Optional embedder audit sink. No guest fuel is charged for observation.
Sourcefn audit_context<'a>(
&self,
_capability: &str,
context: &'a Value,
_cwd: &str,
) -> Cow<'a, Value>
fn audit_context<'a>( &self, _capability: &str, context: &'a Value, _cwd: &str, ) -> Cow<'a, Value>
The metadata actually tested by the policy, including lexical VFS normalization.
fn check_with_cwd( &self, caller: &str, capability: &str, context: &Value, _cwd: &str, ) -> CheckOutcome
Sourcefn recorder(&self) -> Option<&dyn DecisionRecorder>
fn recorder(&self) -> Option<&dyn DecisionRecorder>
The per-run decision recorder, when one is installed. The runtime computes
explanations and captures source lines only while this is Some.
Sourcefn explain(
&self,
_caller: &str,
_capability: &str,
_context: &Value,
_cwd: &str,
) -> Option<DecisionExplanation>
fn explain( &self, _caller: &str, _capability: &str, _context: &Value, _cwd: &str, ) -> Option<DecisionExplanation>
Why the policy would decide as it does for this call, for a recorder.
Called only while Self::recorder is Some, with the context as the host
function built it; the policy applies its own normalization.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".