pub struct InputValidator { /* private fields */ }
Expand description
Input validator for various data types
Implementations§
Source§impl InputValidator
impl InputValidator
Sourcepub fn new(config: SecurityConfig) -> Self
pub fn new(config: SecurityConfig) -> Self
Create a new input validator
Sourcepub fn validate_string(
&self,
input: &str,
field_name: &str,
) -> Result<String, BuildError>
pub fn validate_string( &self, input: &str, field_name: &str, ) -> Result<String, BuildError>
Validate and sanitize a string input
Sourcepub fn validate_path(&self, path: &str) -> Result<PathBuf, BuildError>
pub fn validate_path(&self, path: &str) -> Result<PathBuf, BuildError>
Validate a file path for safety using the comprehensive cross-platform path validator
Sourcepub fn validate_path_with_config(
&self,
path: &str,
config: PathValidationConfig,
) -> Result<PathBuf, BuildError>
pub fn validate_path_with_config( &self, path: &str, config: PathValidationConfig, ) -> Result<PathBuf, BuildError>
Validate a file path with custom configuration
Sourcepub fn validate_url(&self, url_str: &str) -> Result<Url, BuildError>
pub fn validate_url(&self, url_str: &str) -> Result<Url, BuildError>
Validate a URL for safety
Sourcepub fn validate_xml_content(&self, xml: &str) -> Result<(), BuildError>
pub fn validate_xml_content(&self, xml: &str) -> Result<(), BuildError>
Validate XML content for security
Sourcepub fn validate_entities(
&mut self,
entities: &[Entity],
) -> Result<(), BuildError>
pub fn validate_entities( &mut self, entities: &[Entity], ) -> Result<(), BuildError>
Validate entities using advanced classification system
Sourcepub fn classify_entity(&mut self, name: &str, value: &str) -> EntityClass
pub fn classify_entity(&mut self, name: &str, value: &str) -> EntityClass
Classify a single entity
Sourcepub fn get_entity_metrics(&self) -> Option<Vec<EntityMetrics>>
pub fn get_entity_metrics(&self) -> Option<Vec<EntityMetrics>>
Get entity classification metrics
Sourcepub fn validate_json_content(&self, json: &str) -> Result<(), BuildError>
pub fn validate_json_content(&self, json: &str) -> Result<(), BuildError>
Validate JSON content for security
Auto Trait Implementations§
impl Freeze for InputValidator
impl RefUnwindSafe for InputValidator
impl Send for InputValidator
impl Sync for InputValidator
impl Unpin for InputValidator
impl UnwindSafe for InputValidator
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> 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