pub struct TrustedProxyClientIpKeyExtractor { /* private fields */ }Expand description
Extract a client IP key only when the socket peer satisfies an application trust policy.
Use this extractor when trusted proxies and direct or untrusted peers may reach the same
application. It requires the socket peer and validates that peer with the synchronous policy
supplied to Self::new before reading any forwarding Header. Choose one built-in IP extractor
for the application’s network topology; do not layer this extractor with another one.
An untrusted peer always uses its socket IP and all forwarding Headers are ignored. A trusted
peer uses the same Header order and strict parsing as ClientIpKeyExtractor, falling back to
the peer when no supported Header is present.
The policy establishes which transport peers may assert a client address; Header parsing does not authenticate the value. Applications must still ensure every trusted proxy removes or overwrites each supported client-IP Header.
Implementations§
Trait Implementations§
Source§impl Clone for TrustedProxyClientIpKeyExtractor
impl Clone for TrustedProxyClientIpKeyExtractor
Source§fn clone(&self) -> TrustedProxyClientIpKeyExtractor
fn clone(&self) -> TrustedProxyClientIpKeyExtractor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more