pub struct ShellPolicyHandle { /* private fields */ }Expand description
Clonable handle for live policy rebuilds on hot-reload.
Obtained from ShellExecutor::policy_handle at construction time and stored
on the agent. Call ShellPolicyHandle::rebuild to atomically replace the
effective blocked_commands list without recreating the executor. Reads on
the dispatch path are lock-free via ArcSwap::load_full.
Implementations§
Source§impl ShellPolicyHandle
impl ShellPolicyHandle
Sourcepub fn rebuild(&self, config: &ShellConfig)
pub fn rebuild(&self, config: &ShellConfig)
Atomically install a new effective blocklist derived from config.
§Rebuild contract
config must be the already-overlay-merged ShellConfig (i.e. the
value produced by load_config_with_overlay). Plugin contributions are
already present in config.blocked_commands at this point; this method
does NOT re-apply overlays.
Sourcepub fn snapshot_blocked(&self) -> Vec<String>
pub fn snapshot_blocked(&self) -> Vec<String>
Snapshot of the current effective blocklist.
Build a handle from scratch, without an accompanying ShellExecutor (#6588).
Entry points that construct a fresh ShellExecutor per session (ACP, serve — so each
session gets its own RiskChainAccumulator instead of sharing one across concurrent
sessions) need ONE handle shared across every session’s executor, so a hot-reload
(rebuild) reaches all of them. Build this once per connection/server and pass it to
ShellExecutor::with_shared_policy for each session’s executor.
Trait Implementations§
Source§impl Clone for ShellPolicyHandle
impl Clone for ShellPolicyHandle
Source§fn clone(&self) -> ShellPolicyHandle
fn clone(&self) -> ShellPolicyHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ShellPolicyHandle
impl RefUnwindSafe for ShellPolicyHandle
impl Send for ShellPolicyHandle
impl Sync for ShellPolicyHandle
impl Unpin for ShellPolicyHandle
impl UnsafeUnpin for ShellPolicyHandle
impl UnwindSafe for ShellPolicyHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request