pub struct RootSecurityValidator { /* private fields */ }Expand description
Comprehensive security validator for roots
Implementations§
Source§impl RootSecurityValidator
impl RootSecurityValidator
Sourcepub fn new(max_path_depth: usize) -> RootSecurityValidator
pub fn new(max_path_depth: usize) -> RootSecurityValidator
Create a new validator with custom settings
Sourcepub fn add_blocked_path(&mut self, path: String)
pub fn add_blocked_path(&mut self, path: String)
Add a globally blocked path
Sourcepub fn add_blocked_pattern(&mut self, pattern: &str) -> Result<(), Error>
pub fn add_blocked_pattern(&mut self, pattern: &str) -> Result<(), Error>
Add a globally blocked pattern
Sourcepub fn validate_access(
&self,
root: &Root,
target_path: &str,
operation: RootOperation,
) -> Result<(), RootSecurityError>
pub fn validate_access( &self, root: &Root, target_path: &str, operation: RootOperation, ) -> Result<(), RootSecurityError>
Validate a path access request against a root
Sourcepub fn validate_path_within_root(
&self,
root_uri: &str,
path: &str,
) -> Result<(), RootSecurityError>
pub fn validate_path_within_root( &self, root_uri: &str, path: &str, ) -> Result<(), RootSecurityError>
Validate that a path is within the allowed root and secure
Sourcepub fn validate_file_size(
&self,
path: &Path,
security: &Option<RootSecurityConfig>,
) -> Result<(), RootSecurityError>
pub fn validate_file_size( &self, path: &Path, security: &Option<RootSecurityConfig>, ) -> Result<(), RootSecurityError>
Validate file size (if the file exists)
Trait Implementations§
Source§impl Clone for RootSecurityValidator
impl Clone for RootSecurityValidator
Source§fn clone(&self) -> RootSecurityValidator
fn clone(&self) -> RootSecurityValidator
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 RootSecurityValidator
impl Debug for RootSecurityValidator
Source§impl Default for RootSecurityValidator
impl Default for RootSecurityValidator
Source§fn default() -> RootSecurityValidator
fn default() -> RootSecurityValidator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RootSecurityValidator
impl RefUnwindSafe for RootSecurityValidator
impl Send for RootSecurityValidator
impl Sync for RootSecurityValidator
impl Unpin for RootSecurityValidator
impl UnwindSafe for RootSecurityValidator
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