-
Notifications
You must be signed in to change notification settings - Fork 8
Geo lookup + client info (extract-once) #488
Copy link
Copy link
Description
Description
Implement PlatformGeo backed by Fastly SDK. Populate ClientInfo struct from the Fastly request at the entry point and store in RuntimeServices.
Extract-once pattern
ClientInfo is a plain data struct populated once at the entry point — not extracted per-call-site. This eliminates redundant extraction (currently get_client_ip_addr() is called 4+ times in the auction flow alone). Each adapter constructs ClientInfo from its platform request at dispatch time:
- Fastly:
req.get_client_ip_addr(),req.get_tls_protocol(),req.get_tls_cipher_openssl_name() - Cloudflare:
CF-Connecting-IPheader,cfobject TLS fields - Axum: connection info,
X-Forwarded-Forheader
Call sites to migrate
geo.rs—req.get_client_ip_addr()for geo lookup →services.client_info.client_ipsynthetic.rs:71—req.get_client_ip_addr()for ID generation →services.client_info.client_ipdidomi.rs:106—original_req.get_client_ip_addr()for X-Forwarded-For →services.client_info.client_ipauction/formats.rs:134—req.get_client_ip_addr()for DeviceInfo →services.client_info.client_iphttp_util.rs:134,140—req.get_tls_protocol()/req.get_tls_cipher_openssl_name()for scheme detection →services.client_info.tls_protocol/services.client_info.tls_cipher
Done when
ClientInfopopulated at entry point- Geo and client-info reads go through
RuntimeServices - Per-PR gates pass
Blocked by
PR 2
References
docs/internal/EDGEZERO_MIGRATION.md— Phase 1, PR 7- Part of EdgeZero migration #480
Reactions are currently unavailable