Skip to main content

SecurityCheck

Trait SecurityCheck 

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

Source

fn check(&self, caller: &str, capability: &str, context: &Value) -> CheckOutcome

Provided Methods§

Source

fn audit(&self, _decision: AuditDecision<'_>)

Optional embedder audit sink. No guest fuel is charged for observation.

Source

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.

Source

fn check_with_cwd( &self, caller: &str, capability: &str, context: &Value, _cwd: &str, ) -> CheckOutcome

Source

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.

Source

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

Implementors§