pub struct SsrfSafeDnsResolver { /* private fields */ }Expand description
reqwest::dns::Resolve impl that vets every resolved IP against
is_ssrf_blocked before handing addresses back to the HTTP
connector. See module docs for the threat model.
Implementations§
Source§impl SsrfSafeDnsResolver
impl SsrfSafeDnsResolver
Sourcepub fn from_system() -> Result<Self, ToolError>
pub fn from_system() -> Result<Self, ToolError>
Build a resolver from the system’s DNS config (/etc/resolv.conf
on Unix, the Windows registry equivalents otherwise) with no
explicit IP overrides.
Sourcepub fn from_config(
config: ResolverConfig,
opts: ResolverOpts,
) -> Result<Self, ToolError>
pub fn from_config( config: ResolverConfig, opts: ResolverOpts, ) -> Result<Self, ToolError>
Build a resolver with an explicit (config, opts) pair —
useful for tests or for environments that pin a specific
upstream resolver.
Sourcepub fn with_explicit_allow(self, ips: HashSet<IpAddr>) -> Self
pub fn with_explicit_allow(self, ips: HashSet<IpAddr>) -> Self
Replace the explicit-allow set. IPs in the set bypass
is_ssrf_blocked.
Trait Implementations§
Source§impl Debug for SsrfSafeDnsResolver
impl Debug for SsrfSafeDnsResolver
Auto Trait Implementations§
impl Freeze for SsrfSafeDnsResolver
impl !RefUnwindSafe for SsrfSafeDnsResolver
impl Send for SsrfSafeDnsResolver
impl Sync for SsrfSafeDnsResolver
impl Unpin for SsrfSafeDnsResolver
impl UnsafeUnpin for SsrfSafeDnsResolver
impl !UnwindSafe for SsrfSafeDnsResolver
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