pub struct SecurityConfig {
pub level: SecurityLevel,
pub workspace_only: bool,
pub max_actions_per_hour: u32,
pub forbidden_paths: Vec<String>,
pub allowed_roots: Vec<PathBuf>,
pub forbidden_extensions: Vec<String>,
pub read_only: Option<bool>,
pub max_file_size: u64,
pub allow_symlinks: bool,
}Expand description
Security policy configuration
Fields§
§level: SecurityLevelSecurity level preset
workspace_only: boolWhether to restrict operations to workspace only
max_actions_per_hour: u32Maximum file operations per hour
forbidden_paths: Vec<String>Forbidden path prefixes
allowed_roots: Vec<PathBuf>Additional allowed roots outside workspace
forbidden_extensions: Vec<String>Forbidden file extensions
read_only: Option<bool>Read-only mode (overrides level setting)
max_file_size: u64Maximum file size in bytes (0 = unlimited)
allow_symlinks: boolEnable symlink following
Implementations§
Source§impl SecurityConfig
impl SecurityConfig
Sourcepub fn from_level(level: SecurityLevel) -> Self
pub fn from_level(level: SecurityLevel) -> Self
Create config from security level
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Check if read-only mode is enabled
Sourcepub fn merge(&mut self, other: SecurityConfig)
pub fn merge(&mut self, other: SecurityConfig)
Merge with another config (other takes precedence for non-default values)
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§fn clone(&self) -> SecurityConfig
fn clone(&self) -> SecurityConfig
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 moreSource§impl Debug for SecurityConfig
impl Debug for SecurityConfig
Source§impl Default for SecurityConfig
impl Default for SecurityConfig
Source§impl<'de> Deserialize<'de> for SecurityConfigwhere
SecurityConfig: Default,
impl<'de> Deserialize<'de> for SecurityConfigwhere
SecurityConfig: 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnsafeUnpin for SecurityConfig
impl UnwindSafe for SecurityConfig
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> 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