pub struct HttpAclDnsResolver { /* private fields */ }Expand description
A Resolver that checks each resolved address against an HttpAcl before
handing it back to reqwest.
Denies the hostname itself first via HttpAcl::is_host_allowed. For the
addresses it resolves to, a trusted static DNS mapping (see
HttpAclBuilder::add_trusted_static_dns_mapping) is returned as-is; a regular
static mapping or a genuinely resolved address is
filtered through HttpAcl::is_ip_allowed and HttpAcl::is_port_allowed, so
only addresses the ACL permits are ever handed to reqwest. Constructed via
HttpAclMiddleware::dns_resolver or HttpAclMiddleware::with_dns_resolver,
not directly.
Implementations§
Source§impl HttpAclDnsResolver
impl HttpAclDnsResolver
Sourcepub fn new(middleware: &HttpAclMiddleware) -> Self
pub fn new(middleware: &HttpAclMiddleware) -> Self
Create a new ACL resolver that resolves hostnames via getaddrinfo.
Sourcepub fn with_dns_resolver(
middleware: &HttpAclMiddleware,
dns_resolver: Arc<dyn Resolve>,
) -> Self
pub fn with_dns_resolver( middleware: &HttpAclMiddleware, dns_resolver: Arc<dyn Resolve>, ) -> Self
Create a new ACL resolver that delegates actual resolution to a custom
Resolve implementation.