pub struct SecurityValidator { /* private fields */ }Expand description
Security validator with configuration-based limits
Implementations§
Source§impl SecurityValidator
impl SecurityValidator
Sourcepub fn new(config: SecurityConfig) -> Self
pub fn new(config: SecurityConfig) -> Self
Create new validator with given security configuration
Sourcepub fn validate_input_size(&self, size: usize) -> Result<()>
pub fn validate_input_size(&self, size: usize) -> Result<()>
Validate input size against security limits
Sourcepub fn validate_json_depth(&self, depth: usize) -> Result<()>
pub fn validate_json_depth(&self, depth: usize) -> Result<()>
Validate JSON depth to prevent stack overflow
Sourcepub fn validate_array_length(&self, length: usize) -> Result<()>
pub fn validate_array_length(&self, length: usize) -> Result<()>
Validate array length
Sourcepub fn validate_object_keys(&self, key_count: usize) -> Result<()>
pub fn validate_object_keys(&self, key_count: usize) -> Result<()>
Validate object key count
Sourcepub fn validate_string_length(&self, length: usize) -> Result<()>
pub fn validate_string_length(&self, length: usize) -> Result<()>
Validate string length
Sourcepub fn validate_session_id(&self, session_id: &str) -> Result<()>
pub fn validate_session_id(&self, session_id: &str) -> Result<()>
Validate session ID format and length
Sourcepub fn validate_websocket_frame_size(&self, size: usize) -> Result<()>
pub fn validate_websocket_frame_size(&self, size: usize) -> Result<()>
Validate WebSocket frame size
Sourcepub fn validate_buffer_size(&self, size: usize) -> Result<()>
pub fn validate_buffer_size(&self, size: usize) -> Result<()>
Validate buffer size for pooling
Trait Implementations§
Source§impl Clone for SecurityValidator
impl Clone for SecurityValidator
Source§fn clone(&self) -> SecurityValidator
fn clone(&self) -> SecurityValidator
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 SecurityValidator
impl Debug for SecurityValidator
Auto Trait Implementations§
impl Freeze for SecurityValidator
impl RefUnwindSafe for SecurityValidator
impl Send for SecurityValidator
impl Sync for SecurityValidator
impl Unpin for SecurityValidator
impl UnwindSafe for SecurityValidator
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