pub struct ExecutionContext { /* private fields */ }Implementations§
Source§impl ExecutionContext
impl ExecutionContext
pub fn new(security: SecurityContext) -> Self
pub fn from_path(root: impl AsRef<Path>) -> Result<Self, SecurityError>
pub fn permissive() -> Self
pub fn with_hooks( self, hooks: HookManager, session_id: impl Into<String>, ) -> Self
pub fn session_id(&self) -> Option<&str>
pub async fn fire_hook(&self, event: HookEvent, input: HookInput)
pub fn root(&self) -> &Path
pub fn limits_for(&self, tool_name: &str) -> ToolLimits
pub fn resolve(&self, input: &str) -> Result<SafePath, SecurityError>
pub fn resolve_with_limits( &self, input: &str, limits: &ToolLimits, ) -> Result<SafePath, SecurityError>
pub fn resolve_for( &self, tool_name: &str, path: &str, ) -> Result<SafePath, SecurityError>
pub fn try_resolve_for( &self, tool_name: &str, path: &str, ) -> Result<SafePath, ToolResult>
pub fn try_resolve_or_root_for( &self, tool_name: &str, path: Option<&str>, ) -> Result<PathBuf, ToolResult>
pub fn resolve_or_root( &self, path: Option<&str>, limits: &ToolLimits, ) -> Result<PathBuf, SecurityError>
pub fn open_read(&self, input: &str) -> Result<SecureFileHandle, SecurityError>
pub fn open_write(&self, input: &str) -> Result<SecureFileHandle, SecurityError>
pub fn is_within(&self, path: &Path) -> bool
pub fn analyze_bash(&self, command: &str) -> BashAnalysis
pub fn validate_bash(&self, command: &str) -> Result<BashAnalysis, String>
pub fn resource_limits(&self) -> &ResourceLimits
pub fn check_domain(&self, domain: &str) -> DomainCheck
pub fn can_bypass_sandbox(&self) -> bool
pub fn is_sandboxed(&self) -> bool
pub fn should_auto_allow_bash(&self) -> bool
pub fn wrap_command(&self, command: &str) -> SandboxResult<String>
pub fn sandbox_env(&self) -> HashMap<String, String>
pub fn sanitized_env_with_sandbox(&self) -> SanitizedEnv
pub fn check_permission( &self, tool_name: &str, input: &Value, ) -> PermissionResult
pub fn validate_security( &self, tool_name: &str, input: &Value, ) -> Result<(), String>
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§fn clone(&self) -> ExecutionContext
fn clone(&self) -> ExecutionContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExecutionContext
impl !RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl !UnwindSafe for ExecutionContext
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreCreates a shared type from an unshared type.