pub fn get_client_ip(headers: &HeaderMap, extensions: &Extensions) -> StringExpand description
Extracts the client IP address from HTTP headers and extensions, formatted as a string for logging.
A thin wrapper over micromegas_auth::client_ip::resolve_client_ip, which owns the actual
resolution logic (X-Forwarded-For / X-Real-IP / socket address priority, with the
to_canonical() normalization) – moved into the auth crate so IpAllowlist::allows can
consult the same resolution for an authorization decision, not just for this function’s
audit-logging callers. See that function’s doc comment for the full priority order and
anti-spoofing rationale.
Returns “unknown” if no IP can be extracted.