pub struct EgressGuard { /* private fields */ }Expand description
Egress guard over request-derived upstream URLs.
Implementations§
Source§impl EgressGuard
impl EgressGuard
pub fn new(allowlist: Option<UpstreamAllowlist>) -> Self
Sourcepub fn check_without_dns(&self, target: &str) -> EgressDecision
pub fn check_without_dns(&self, target: &str) -> EgressDecision
Synchronous checks that need no network: literal IPs, metadata hostnames, and allowlist matching.
Exposed separately so callers (and tests) can exercise the pure logic without DNS.
Sourcepub async fn check_with_resolver<R, F>(
&self,
target: &str,
resolver: R,
) -> EgressDecision
pub async fn check_with_resolver<R, F>( &self, target: &str, resolver: R, ) -> EgressDecision
Full check with an injected resolver: synchronous rules first, then resolve non-literal hostnames and re-check every returned address.
Resolution closes the DNS-rebinding window between check and connect: whatever addresses the name currently points at must all be public. Residual risk: the OS resolver could answer differently when reqwest dials; pinning the checked address onto the connection is out of scope here.
Sourcepub async fn check(&self, target: &str) -> EgressDecision
pub async fn check(&self, target: &str) -> EgressDecision
Full check using blocking system DNS off the async runtime’s core threads.
Trait Implementations§
Source§impl Clone for EgressGuard
impl Clone for EgressGuard
Source§fn clone(&self) -> EgressGuard
fn clone(&self) -> EgressGuard
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EgressGuard
impl Debug for EgressGuard
Source§impl Default for EgressGuard
impl Default for EgressGuard
Source§fn default() -> EgressGuard
fn default() -> EgressGuard
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EgressGuard
impl RefUnwindSafe for EgressGuard
impl Send for EgressGuard
impl Sync for EgressGuard
impl Unpin for EgressGuard
impl UnsafeUnpin for EgressGuard
impl UnwindSafe for EgressGuard
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