pub enum ExecAccess {
Mode(ExecMode),
Allowlist(Vec<String>),
}Expand description
Subprocess-execution capability a stdio addon declares.
Modeled as an untagged enum so the manifest can write either a mode string or a binary allowlist:
exec = "none" # block all child process execution (default)
exec = "full" # may execute any binary
exec = ["lean-ctx", "git"] # may execute exactly these binaries (by name/path)exec is a declared, audited and consented capability — it is not
OS-enforced (see super::sandbox): path-allowlisting execve is not
portable (bwrap/seccomp cannot do it) and breaks interpreted servers,
whose own interpreter chain is itself a process-exec. The real data-safety
guarantees come from the network/filesystem sandbox, which child processes
inherit — so a subprocess an addon spawns still cannot exfiltrate or tamper.
Declaring exec keeps the audit honest (an addon that shells out must say
so) and is surfaced for consent at install on every platform.
Variants§
Mode(ExecMode)
A bare mode: "none" (block all child exec) or "full" (unrestricted).
Allowlist(Vec<String>)
An explicit allowlist of binary names / absolute paths the addon may
execve. An empty list is equivalent to ExecMode::None.
Implementations§
Source§impl ExecAccess
impl ExecAccess
Sourcepub fn allowed(&self) -> bool
pub fn allowed(&self) -> bool
Whether the addon is permitted to execute any child process at all.
full and a non-empty allowlist are permissive; none / empty list are
not.
Sourcepub fn is_restricted(&self) -> bool
pub fn is_restricted(&self) -> bool
Whether this is a restricted declaration (none or an allowlist) vs.
blanket full. Drives the audit/consent disclosure, not OS enforcement.
Trait Implementations§
Source§impl Clone for ExecAccess
impl Clone for ExecAccess
Source§fn clone(&self) -> ExecAccess
fn clone(&self) -> ExecAccess
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExecAccess
impl Debug for ExecAccess
Source§impl Default for ExecAccess
impl Default for ExecAccess
Source§impl<'de> Deserialize<'de> for ExecAccess
impl<'de> Deserialize<'de> for ExecAccess
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>,
impl Eq for ExecAccess
Source§impl PartialEq for ExecAccess
impl PartialEq for ExecAccess
Source§impl Serialize for ExecAccess
impl Serialize for ExecAccess
impl StructuralPartialEq for ExecAccess
Auto Trait Implementations§
impl Freeze for ExecAccess
impl RefUnwindSafe for ExecAccess
impl Send for ExecAccess
impl Sync for ExecAccess
impl Unpin for ExecAccess
impl UnsafeUnpin for ExecAccess
impl UnwindSafe for ExecAccess
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
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>
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>
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