pub struct AddonCapabilities {
pub network: NetworkAccess,
pub filesystem: FilesystemAccess,
pub env: Vec<String>,
pub exec: ExecAccess,
}Expand description
[capabilities] — what an addon is permitted to do. A present-but-empty
block resolves to the strictest profile (see module docs). Secure-by-default.
Fields§
§network: NetworkAccessOutbound network access.
filesystem: FilesystemAccessFilesystem access.
env: Vec<String>Host environment variable names the addon may receive, in addition to
BASE_ENV_ALLOWLIST. Anything not listed is scrubbed before spawn, so
ambient secrets never reach the child process.
exec: ExecAccessSubprocess-execution permission. Defaults to ExecMode::None inside a
declared block (secure-by-default): an addon that spawns child processes
(e.g. shells out, or calls back into lean-ctx call) must declare it.
Implementations§
Source§impl AddonCapabilities
impl AddonCapabilities
Sourcepub fn is_minimal(&self) -> bool
pub fn is_minimal(&self) -> bool
True when the addon declares no elevated capability — the strictest, default profile and the safest to run.
Sourcepub fn exec_allowed(&self) -> bool
pub fn exec_allowed(&self) -> bool
Whether the addon may execute child processes at all.
Sourcepub fn exec_restricted(&self) -> bool
pub fn exec_restricted(&self) -> bool
Whether the addon declares a restricted exec profile (none or an
allowlist, vs. blanket full). Used by the audit + consent surface;
exec is not OS-enforced (see super::sandbox).
Sourcepub fn exec_is_blanket(&self) -> bool
pub fn exec_is_blanket(&self) -> bool
Whether exec is a blanket full grant (vs. an allowlist or none). Used
by the audit to nudge blanket grants toward least privilege.
Sourcepub fn network_allowed(&self) -> bool
pub fn network_allowed(&self) -> bool
Whether the OS sandbox should permit outbound network for this addon.
Sourcepub fn filesystem_writable(&self) -> bool
pub fn filesystem_writable(&self) -> bool
Whether the OS sandbox should permit filesystem writes for this addon.
Trait Implementations§
Source§impl Clone for AddonCapabilities
impl Clone for AddonCapabilities
Source§fn clone(&self) -> AddonCapabilities
fn clone(&self) -> AddonCapabilities
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 AddonCapabilities
impl Debug for AddonCapabilities
Source§impl Default for AddonCapabilities
impl Default for AddonCapabilities
Source§fn default() -> AddonCapabilities
fn default() -> AddonCapabilities
Source§impl<'de> Deserialize<'de> for AddonCapabilitieswhere
AddonCapabilities: Default,
impl<'de> Deserialize<'de> for AddonCapabilitieswhere
AddonCapabilities: Default,
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 AddonCapabilities
Source§impl PartialEq for AddonCapabilities
impl PartialEq for AddonCapabilities
Source§impl Serialize for AddonCapabilities
impl Serialize for AddonCapabilities
impl StructuralPartialEq for AddonCapabilities
Auto Trait Implementations§
impl Freeze for AddonCapabilities
impl RefUnwindSafe for AddonCapabilities
impl Send for AddonCapabilities
impl Sync for AddonCapabilities
impl Unpin for AddonCapabilities
impl UnsafeUnpin for AddonCapabilities
impl UnwindSafe for AddonCapabilities
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