pub struct SsrfValidator { /* private fields */ }Expand description
SSRF validator with configurable blocked CIDR ranges
Implementations§
Source§impl SsrfValidator
impl SsrfValidator
Sourcepub fn new(allow_private_ips: bool) -> Self
pub fn new(allow_private_ips: bool) -> Self
Create a new SSRF validator with default blocked ranges
Sourcepub fn add_blocked_range(&mut self, cidr: &str) -> Result<(), String>
pub fn add_blocked_range(&mut self, cidr: &str) -> Result<(), String>
Add a custom blocked CIDR range
Sourcepub fn validate_url(&self, url: &str) -> Result<(), String>
pub fn validate_url(&self, url: &str) -> Result<(), String>
Validate a URL for SSRF vulnerabilities
Sourcepub fn is_blocked(&self, url: &str) -> bool
pub fn is_blocked(&self, url: &str) -> bool
Check if a URL would be blocked (non-failing version for testing)
Trait Implementations§
Source§impl Clone for SsrfValidator
impl Clone for SsrfValidator
Source§fn clone(&self) -> SsrfValidator
fn clone(&self) -> SsrfValidator
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 SsrfValidator
impl Debug for SsrfValidator
Auto Trait Implementations§
impl Freeze for SsrfValidator
impl RefUnwindSafe for SsrfValidator
impl Send for SsrfValidator
impl Sync for SsrfValidator
impl Unpin for SsrfValidator
impl UnsafeUnpin for SsrfValidator
impl UnwindSafe for SsrfValidator
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