-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Context
After rebasing the consent management branch onto main (which introduced the trusted_server_openrtb shared crate), there are a few cleanup items that don't belong in the consent PR itself.
Items
1. Dead is_gdpr_country in geo.rs (medium priority)
crates/common/src/geo.rs defines is_gdpr_country() and a static GDPR_COUNTRIES HashSet (lines 114-136). This function is now only called by its own tests — production code uses the config-driven consent_config.gdpr.applies_in list via consent::jurisdiction::detect_jurisdiction() instead.
There are now two independent GDPR country lists maintained in:
crates/common/src/geo.rs:114—LazyLock<HashSet<&str>>crates/common/src/consent_config.rs:20—const GDPR_COUNTRIES: &[&str]
They're identical today but could drift. The geo.rs version should be removed and its tests deleted (or migrated to test the consent config default).
2. Local Eid/Uid vs shared crate types (low priority, future work)
crates/common/src/openrtb.rs defines local Eid and Uid structs (lines 73-93) that are structurally different from the shared trusted_server_openrtb::Eid/Uid:
| Field | Local | Shared |
|---|---|---|
Eid.source |
String (required) |
Option<String> |
Eid.inserter/matcher/mm/ext |
Missing | Present |
Uid.id |
String (required) |
Option<String> |
Uid.atype |
Option<u8> |
Option<i32> |
Uid.ext |
Option<Value> |
Option<Map<String,Value>> |
The local types are used by UserExt.eids, which is currently always None (pre-positioned for future EID support). When EID identity provider integration is implemented, the PR should decide whether to:
- Use the shared crate's
Eid/Uidtypes directly (richer, spec-complete) - Keep the local simplified types with a conversion layer
- Remove the local types entirely
No action needed until EID support goes live.
Acceptance Criteria
- Remove
is_gdpr_country(),GDPR_COUNTRIESHashSet, and associated tests fromgeo.rs - Verify no other production code depends on
is_gdpr_country - All CI gates pass after removal