pub struct HostAllowlist { /* private fields */ }Expand description
Host allowlist. Fail-closed: empty allowlist rejects everything.
Implementations§
Source§impl HostAllowlist
impl HostAllowlist
Sourcepub fn add_exact_host(self, host: impl Into<String>) -> Self
pub fn add_exact_host(self, host: impl Into<String>) -> Self
Append an exact hostname rule (case-insensitive). IDN inputs are normalized to Punycode so a Cyrillic-look-alike domain cannot bypass an entry registered in Latin script (or vice versa).
Sourcepub fn add_subdomain_root(self, host: impl Into<String>) -> Self
pub fn add_subdomain_root(self, host: impl Into<String>) -> Self
Append a wildcard-subdomain rule. The leading *. is
optional in the supplied string; both *.example.com and
example.com are accepted as input and stored without the
*. prefix for matching. Inputs are normalized to Punycode
the same way as Self::add_exact_host.
Sourcepub fn add_exact_ip(self, ip: IpAddr) -> Self
pub fn add_exact_ip(self, ip: IpAddr) -> Self
Append an exact IP literal rule. Intended for narrow on-prem
allowances; prefer allow_exact over this for hostnames.
Sourcepub fn explicit_ips(&self) -> HashSet<IpAddr>
pub fn explicit_ips(&self) -> HashSet<IpAddr>
Borrow every IP registered via Self::add_exact_ip.
Used by HttpFetchToolBuilder to seed the SSRF-safe DNS
resolver’s explicit-allow set so on-prem private-IP
allowances pass the connect-time block.
Trait Implementations§
Source§impl Clone for HostAllowlist
impl Clone for HostAllowlist
Source§fn clone(&self) -> HostAllowlist
fn clone(&self) -> HostAllowlist
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HostAllowlist
impl Debug for HostAllowlist
Source§impl Default for HostAllowlist
impl Default for HostAllowlist
Source§fn default() -> HostAllowlist
fn default() -> HostAllowlist
Auto Trait Implementations§
impl Freeze for HostAllowlist
impl RefUnwindSafe for HostAllowlist
impl Send for HostAllowlist
impl Sync for HostAllowlist
impl Unpin for HostAllowlist
impl UnsafeUnpin for HostAllowlist
impl UnwindSafe for HostAllowlist
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
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>
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>
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