Skip to content

Geo lookup + client info (extract-once) #488

Closed

Description

@aram356

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-IP header, cf object TLS fields
  • Axum: connection info, X-Forwarded-For header

Call sites to migrate

  • geo.rs — req.get_client_ip_addr() for geo lookup → services.client_info.client_ip
  • synthetic.rs:71 — req.get_client_ip_addr() for ID generation → services.client_info.client_ip
  • didomi.rs:106 — original_req.get_client_ip_addr() for X-Forwarded-For → services.client_info.client_ip
  • auction/formats.rs:134 — req.get_client_ip_addr() for DeviceInfo → services.client_info.client_ip
  • http_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

  • ClientInfo populated at entry point
  • Geo and client-info reads go through RuntimeServices
  • Per-PR gates pass

Blocked by

PR 2

References

Activity

  1. self-assigned this
    on Mar 12, 2026
  2. added theissue type on Mar 12, 2026
  3. changed the title [-]EZ PR 7: Geo lookup + client info traits[/-] [+]Geo lookup + client info traits[/+] on Mar 12, 2026
  4. removed their assignment
    on Mar 13, 2026
  5. changed the title [-]Geo lookup + client info traits[/-] [+]Geo lookup + client info (extract-once)[/+] on Mar 17, 2026
  6. self-assigned this
    on Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions