toolkit/http/client_ip.rs
1//! The caller's address as the edge resolved it.
2
3use std::net::IpAddr;
4
5/// Request extension carrying the client address the API gateway resolved
6/// from the connection (and, behind trusted proxies, from their forwarding
7/// headers).
8///
9/// Only the gateway inserts it; handlers read it instead of parsing
10/// `X-Forwarded-For` / `X-Real-IP`, which the client controls. A request that
11/// did not come through the gateway (an in-process client call) has none.
12#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13pub struct ClientIp(pub IpAddr);