pub struct SandboxPolicy {
pub env_passthrough: bool,
pub allow_network: bool,
pub allow_fs_write: bool,
}Expand description
The resolved, enforceable sandbox for a plugin subprocess. The derived
Default is least privilege (all false): scrubbed env, nothing declared.
Fields§
§env_passthrough: boolWhen false (default) the child runs with a scrubbed env (allowlist only).
allow_network: boolDeclared network intent (surfaced, not OS-enforced).
allow_fs_write: boolDeclared out-of-dir write intent (surfaced, not OS-enforced).
Implementations§
Source§impl SandboxPolicy
impl SandboxPolicy
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
A policy mirroring legacy behavior (full host env). Used only where the caller is not a plugin (e.g. direct internal subprocess helpers/tests).
pub fn from_permissions(perms: &[Permission]) -> Self
Sourcepub fn declared_permissions(&self) -> Vec<&'static str>
pub fn declared_permissions(&self) -> Vec<&'static str>
The declared permissions, as stable strings (for capabilities/audit).
Trait Implementations§
Source§impl Clone for SandboxPolicy
impl Clone for SandboxPolicy
Source§fn clone(&self) -> SandboxPolicy
fn clone(&self) -> SandboxPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SandboxPolicy
Source§impl Debug for SandboxPolicy
impl Debug for SandboxPolicy
Source§impl Default for SandboxPolicy
impl Default for SandboxPolicy
Source§fn default() -> SandboxPolicy
fn default() -> SandboxPolicy
Returns the “default value” for a type. Read more
impl Eq for SandboxPolicy
Source§impl PartialEq for SandboxPolicy
impl PartialEq for SandboxPolicy
Source§fn eq(&self, other: &SandboxPolicy) -> bool
fn eq(&self, other: &SandboxPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SandboxPolicy
Auto Trait Implementations§
impl Freeze for SandboxPolicy
impl RefUnwindSafe for SandboxPolicy
impl Send for SandboxPolicy
impl Sync for SandboxPolicy
impl Unpin for SandboxPolicy
impl UnsafeUnpin for SandboxPolicy
impl UnwindSafe for SandboxPolicy
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more