build_origin_metadata

Function build_origin_metadata 

Source
pub fn build_origin_metadata(
    headers: &HeaderMap,
    addr: &SocketAddr,
) -> MetadataMap
Expand description

Build origin tracking metadata for FlightSQL queries Augments the client type by appending “+gateway” to preserve the full client chain

This function only sets origin tracking headers that the gateway controls:

  • x-client-type: augmented with “+gateway”
  • x-request-id: generated if not present
  • x-client-ip: extracted from actual connection (prevents spoofing)

User attribution headers (x-user-id, x-user-email) are forwarded from client if present in allowed_headers config. FlightSQL validates these against the Authorization token.