Repository navigation
Conversation
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids from the Prebid config into the auction EIDs, and a99dd66, a62601b, d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30 days from the UTC day start and pass the request time into finalize. They arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623, #1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646, with #1646's move of the request time into IdentityApp::finalize. It also brings d5276ee, which publishes the native AWS runtime files without GNU mv -T, and Christian's merge 5597d3e of #1538 into #1540, through #1566's merge. The base now also carries the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which decodes the Spin discovery document with Response::json, and #1627's merge of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI. This PR already carries #1646's head 461aa0d, so the merge adds only #1646's new merge 166944769 of #1642 and the chain below it, including the identity conformance check that now strips the mirrored UID's exp. It also brings b2d4bfd from #1488, which records the known UID hashes on lookup results with a setter, so the provider IDs the write planner logs are not derived from them. Restacking on the Axum serving line conflicts in the Axum startup tests, where #1617 waits for /ready, since liveness stays up after a caught initialization failure, and this PR rewrites the wait to retry a port collision and to require the child's own ready lifecycle event. Axum startup tests: wait_ready keeps this PR's collision retry and lifecycle check, then probes #1617's /ready and returns the /health response once the child is ready. The fixture drains each child's output through this PR's log readers, so #1617's assert_serves_failure_router reaps the stopped child and reads those captured logs instead of collecting the pipes, which the readers already own. The base now also carries #1506's repin of EdgeZero to rc/identity at d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. This PR now stacks on #1661 instead of #1646, so rc/identity can take both as plain merges. #1661 sits on #1656 and #1626, which sit on #1646, so the merge also brings #1626 (provider opt-outs and legacy EID expiry on Fastly and Axum), #1656 (the configurable Edge Cookie browser gate) and #1661 (refusing EC creation when a trusted JA4 contradicts the User-Agent). Fastly identity conformance fixture: #1661 records each scenario's runtime TLS JA4 through a RuntimeTlsJa4 middleware in place of derived device signals, takes the User-Agent from the scenario and drops the browser flag. This PR adds geo consent requests with their own trusted client IP settings and no browser device signals. The merge assembles the conformance app with #1661's middleware and keeps this PR's geo_configured flag and producer_settings. It sends the scenario's User-Agent unless the API request supplies one, and inserts the scenario's JA4 only for requests without a geo consent exchange, because this PR derived device signals only for those. The base now also carries #1627's 4d0c1a2, which renames the generic runtime KV store to trusted_server_runtime_kv, #1488's a610152 and 9104fd3, which add hashed-email intake for the LiveRamp and ID5 identity providers, #1646's aa31559, which gates identity writes for rejected clients, and #1626's d07f789, which withholds a mirrored UID while another source owner is opted out. Fastly conformance JA4: the rebuilt #1661 merge supplies a trusted Python JA4 behind the Chrome User-Agent for #1646's known non-browser API requests, and this PR inserts the scenario's JA4 only without a geo consent exchange, with its producer_settings. The merge keeps both: a known non-browser request gets the Python JA4, any other request the scenario's JA4 unless it is a geo consent exchange. This PR's head moves to e8015ca, its clean merge of #1646's aa31559, which the base already carries, so it adds no change beyond the base. Axum lib.rs: the base now carries #1636, through #1626's merge of it, whose after_response_drain_tests module sits where this PR adds its geo_conformance module. The crate keeps both test modules.
|
For the identity integration branch (#1608), I pushed
I changed the base to |
|
For the identity integration branch (#1608), I pushed |
The Axum geo consent test runs three servers: one whose trusted proxy range covers the test client, one whose range does not (`untrusted`), and one with geo turned off (`unselected`). The first was named `trusted`, which reads as a credential-like value rather than a server. Rename it to `accepted`, for the server that accepts the client's geo headers. The test is otherwise unchanged.
|
For the identity integration branch (#1608), I pushed |
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
This PR adds a shared geo-to-consent test matrix in trusted_server_core::test_support::geo_consent, backed by a JSON location table. The matrix runs against Axum (managed native ingress with CloudFront, a supplied failing provider, and geo turned off), against the production Axum binary, and against Fastly through a Viceroy launcher that builds a temporary geolocation mapping. A new CI step runs the Fastly launcher. I found no bugs. There is one minor robustness concern in the Axum test fixtures. Nothing in the PR text or code tries to steer the reviewer.
Non-blocking
🤔 thinking
- Fixture readiness and port-retry detection depend on log/error strings from upstream — see inline at
crates/trusted-server-adapter-axum/tests/startup.rs:478
Cross-cutting / body-level findings
- 📝 Fastly geo data now fails closed — This is the only production change.
geo_from_fastlynow returnsNonefor countries outside EdgeZero's list of ISO-assigned codes (for example XK, EU, A1, O1). It also drops subdivisions that failSubdivisionCodevalidation (for example?,NO REGION, or empty) and keeps the valid country. Bad Fastly geo data is therefore treated as Unknown rather than NonRegulated. The README documents this, and the Fastly matrix covers it. - 👍 The test fixtures are sound — Everything else in the diff is test and fixture code. The Axum fixture preloads 4096 replies per path, which easily covers the number of requests the matrix sends. The Fastly rebuild gate (
geo_configured) and the forwarding variants behave correctly.
CI Status
- integration tests: PASS
- integration tests (Fastly EC lifecycle): PASS
- trace runtime and browser acceptance: PASS
- browser integration tests: PASS
- health-startup (fastly): PASS
- health-startup (axum): PASS
- health-startup (cloudflare): PASS
- health-startup (spin): PASS
- local-provider-image: PASS
- record-provider-image: PASS
- prepare integration artifacts: PASS
- stock-celld-records: PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- cargo test: PASS
- ts dev lint domains (changed lines): PASS
- release scripts: PASS
- vitest: PASS
- cargo test (cross-adapter parity): PASS
- CLAUDE.md symlink guard: PASS
- Native provider acceptance script: PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- worker-deadlines (cloudflare): PASS
- cargo fmt: PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- Fastly response diff script: PASS
- format-typescript: PASS
- format-docs: PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- cargo test (axum native): PASS
- docs-proposal scripts: PASS
- HTML EOF runtime (Fastly): PASS
- CI Node pin guard: PASS
- worker-deadlines (spin): PASS
| self.diagnostics() | ||
| ); | ||
| // Readiness belongs to this child, not whichever process won the port. | ||
| if self |
There was a problem hiding this comment.
🤔 thinking — Fixture readiness and port-retry detection depend on log/error strings from upstream
Readiness now waits for the exact log line event=lifecycle phase=ready reason=ready in the child process's output. Port-retry detection likewise waits for startup bind: listener: address unavailable, both here and in geo_conformance.rs:241. Neither string is defined in this repository; both come from the pinned EdgeZero dependency. If upstream rewords either one, every wait_ready caller in this file will hang for the full 30 seconds and then fail with a timeout. That error won't point to the real cause.
You could move these strings into named constants with a comment saying where they come from. Another option is a small assertion test that fails with a clear message when a successful startup doesn't print the expected readiness line.
|
For the identity integration branch (#1608), I pushed Takes #1661's new head 5d951a7, which carries #1506's repin of EdgeZero to rc/identity at 1619078a (8edc50e), a revert that removes IABTechLab/edgezero#522 (portable Fastly record providers) and IABTechLab/edgezero#524 (outbound mTLS client identities). The merge is clean. |
ChristianPavilonis
left a comment
There was a problem hiding this comment.
I reviewed #1659 at ba66774e5 against #1661 at 5d951a783. I found no production regression. The hosted logs confirm that both mapped Fastly tests, the managed Axum matrix, and the production Axum /auction test ran and passed. The most useful follow-ups are to test Purpose 1 on its own and make the stale-header and forwarding controls distinguish the behavior they’re meant to catch. The inline comments are non-blocking.
| impl Signal { | ||
| /// Raw cookies to exercise extraction and forwarding. | ||
| #[must_use] | ||
| pub fn cookie(self) -> String { |
There was a problem hiding this comment.
R1. Test Purpose 1 on its own
The standalone and GPP “Purpose 1” cases both use a fixture that also grants Purpose 4. The matrix would still pass if either auction path accidentally required both. Could the geo suite use a Purpose-1-only fixture and leave the identity suite’s fixture unchanged?
| "should refuse EC creation despite stale origin country" | ||
| ); | ||
| assert_eq!( | ||
| result.bids.len(), |
There was a problem hiding this comment.
R2. Make the stale-header probe distinguish auction admission
Stale DE/BE and Unknown give the same dispatch result for both signals in this probe: deny without Purpose 1, allow with it. The EC and bidder-payload checks are useful, but the bidder count can’t tell which jurisdiction the publisher auction used. Could the admission probe use a stale non-regulated location such as US/WY? This doesn’t require changing the deferred header behavior.
| Forwarding::Trusted => {} | ||
| Forwarding::DuplicatedIp => api | ||
| .headers | ||
| .push(("x-example-reader-ip".to_owned(), "198.51.100.7".to_owned())), |
There was a problem hiding this comment.
R3. Use mapped addresses in both forwarding controls
The second address is unmapped in both the duplicate-header and comma-separated cases. If the resolver picked that address instead of rejecting the input, the runtime test would still see no geo. Could both addresses come from distinct mapped rows? Including the forwarding case, signal, and route in failure messages would also make a regression easier to locate.
| Policy::Unknown => false, | ||
| }; | ||
| let ec = cookies(observed); | ||
| let expired = ec.iter().any(|cookie| cookie.contains("Max-Age=0")); |
There was a problem hiding this comment.
R4. Check whether the browser keeps the cookie
A response that echoes the original EC value with Max-Age=-1 or a past Expires passes the retention check if the record stays live, even though the browser drops the cookie. Could this use the existing IdentityJar expiry logic and keep the separate record-liveness check? The current Max-Age=0 deletion is already covered.
| /// Finalized response headers for geo conformance. | ||
| pub headers: http::HeaderMap, | ||
| /// Actual outbound bidder payloads for geo conformance. | ||
| pub bids: Vec<serde_json::Value>, |
There was a problem hiding this comment.
R5. Optional: keep geo captures in the Fastly runner
Only Fastly’s geo runner uses these new fields. The Axum identity runner returns an empty bidder vector without measuring dispatch, so empty can mean either “not measured” or “no dispatch.” Could the extra captures stay on a private Fastly execution result?
| geo_consent::Policy::Gdpr | geo_consent::Policy::Unknown | ||
| )); | ||
| if allowed { | ||
| assert_bid(&body); |
There was a problem hiding this comment.
R6. Optional: share the auction expectations
The production-process test duplicates the matrix’s /auction request and its admission and geo expectations. Could it reuse the shared request and test-only expectations while keeping the real process and bidder capture separate?
| let mut values = ClientRequestValues::read(&mut request, &self.settings, false); | ||
| let mut producer_settings = self.settings.clone(); | ||
| if geo_request.is_some() { | ||
| producer_settings.trusted_client_ip = Some(TrustedClientIpConfig { |
There was a problem hiding this comment.
R7. Optional: use one Fastly fixture trust configuration
This is a second copy of the trust configuration used to assemble the app, and it’s the copy the native parser actually reads. Could assembly, ingress, and request construction use one fixture configuration so they can’t drift?
Summary
Part of #1518. Stacked on #1646. Parent: #1558.
Verify that trusted geography reaches EC lifecycle and both server-side auction paths consistently on Axum and Fastly. One shared location table drives new/returning document navigation, EC GET/POST, publisher SSAT,
/auction, assets and API requests with eight consent representations. The tests observe finalized cookies/geo headers and actual bidder OpenRTB, with authoritative record liveness checked separately.The suite exposed a Fastly producer bug: empty country values reached
NonRegulatedand issued an EC without consent. Reject unusable SDK country codes before creatingGeoInfo; the same missing-location snapshot then reaches every consumer. Invalid or sentinel subdivisions (?,NO REGION, empty, or anything else failing EdgeZero'sSubdivisionCodecheck) are dropped and the valid country is kept, matchingGeoOutcome::platform. This preserves existing consent policy, valid Fastly SDK country/region casing, its local lookup, and the EdgeZero pin9d02d7b3.Changes
ctx.geo(). Separate production-binary process acceptance reuses the startup harness.Geo surface map
Paths and line numbers in this table describe PR head
e8015cae4, relative tocrates/.Shared matrixmeansgeo_conformance::geo_consent_axumandidentity_conformance::geo_consent_fastly;process acceptancemeansmanaged_geo_consumers::geo_consent_runtime_axum.adapter-axum/src/platform.rs:30,43: snapshots privatectx.geo(); only Selected+Located projects country/subdivision; unavailable/untrusted/error/unselected project no locationplatform::tests::unavailable_outcomes_and_forged_extensions_cannot_supply_geographyadapter-fastly/src/main.rs:397,449;platform.rs:271: resolve client IP, then oneRequestGeo::lookup_once; SDK values copied bygeo_from_fastlyatplatform.rs:217(invalid countries now rejected; invalid/sentinel subdivisions dropped, country kept)adapter-fastly/src/platform.rs:313,331: exactly one configured auth header must authenticate, exactly one configured IP header must parse as bare IPv4/IPv6. Missing/duplicate/malformed/forged inputs fall back to peer.compat.rs:44resolves before sanitizationgeo_consent_fastly_forwarding, shared untrusted row; existing resolver testsnative_geo.rs:96selects protected provider; actual owned peer must match declared protected CIDR. ALB verifies origin credentials; TS strips the dedicated credential headercore/src/consent/jurisdiction.rs:46;consent_config.rs:20,26,166,188: configured GDPR list includes GB; US privacy-state match requires subdivision; country-only US remains NonRegulatedconsent::testscore/src/ec/app/lifecycle.rs:60,100,130;ec/mod.rs:386,407,459,490: holds geo and consent jurisdiction together; creates only for eligible navigation/EC POSTec::tests; existing identity conformancecore/src/ec/app/route.rs:94,117: reads geo/consent but is read-only for EC creation and does not finalize withdrawalcore/src/ec/app/route.rs:138,142,159,181: prepares raw consent snapshot, reads request geo, creates and finalizescore/src/consent/mod.rs:540: GDPR needs effective TCF P1; US privacy states require a usable non-opt-out signal; NonRegulated permits; Unknown refuses new ECcore/src/consent/mod.rs:602-626: GDPR TCF denial and applicable US opt-outs withdraw; Unknown/NonRegulated do not.ec/finalize.rs:686,696requires explicit withdrawal plus received EC.ec/mod.rs:395,469retains an existing identitycore/src/publisher.rs:4552,4616,5015,5738: uses EC context geo and consent for admission and auction devicecore/src/publisher.rs:7316,7321,7451: uses same EC geo/consent gate/auctioncore/src/auction/endpoints.rs:295,395: admission reads EC consent; device builder separately calls the geo servicecore/src/auction/openrtb.rs:394,662-704: copies country/region and forwards GDPR/GPP/section/US Privacy fields from consentauction::testscore/src/integrations/prebid.rs:2949,3092;aps.rs:1162: serializes supplied country/region and privacy fieldscore/src/ec/kv_types.rs:687,960;ec/finalize.rs:531;ec/registry.rs:91;ec/coordinator/mod.rs:470ec::testscore/src/geo.rs:27; Axummiddleware.rs:146clears stale geo; Fastlymiddleware.rs:196,201applies held geo or unavailable flagcore/src/integrations/didomi.rs:160,305,419independently reads geo service; canonicalizes trusted country/subdivision, never takes caller geo as authoritycore/src/integrations/registry.rs:341,421,983; DataDomeprotection.rs:156receives held geo/ASNapp.rs:1331reads RequestGeo; Axumapp.rs:886reads fixed services only in explicit-service routers, otherwise pre-dispatch metadata has no geo. Document trace uses EC geo at corepublisher.rs:5614,5853; projections attrace/context.rs:48core/src/auction/telemetry.rs:177;consent/mod.rs:647,688;ec/mod.rs:416,475;publisher.rs:4632use request context country/region/jurisdictionFastly makes one host geo lookup per request; its
RequestGeoanswers repeat service calls from that held result and only for the resolved IP. Axum resolves the managed provider once andAxumPlatformGeoclones the request snapshot./auction, Didomi and explicit-service trace paths call the service independently, but neither adapter performs a fresh geo resolution for those calls.Case matrix
The single JSON location table crosses eight signals (none, TCF P1, TCF denial, GPP TCF sections 2/6, GPP US section 7, GPP opt-out section 9, US Privacy, Sec-GPC), six request kinds and new/returning readers. Publisher document cases also exercise SSAT, so creation and auction admission see the same source data in one request.
?,NO REGION, empty,US-CA) with a valid countrySubdivisionCode, country kept (DE stays GDPR; US is country-only NonRegulated)us/ca→US/CAbefore consumers/auction, assets/APIsThere are 2,880 shared exchanges on Axum and 2,784 on Fastly, excluding 1,440/1,392 seed requests: 8 signals × 6 request kinds × new/returning across the table's 30 locations (29 on Fastly, which has no unselected row). Counted from a real run at
e8015cae4. Fastly adds 17 forwarding exchanges and two explicit deferred stale-origin header controls. Separate Axum production-process acceptance covers 87 auctions using the same location table (every row except the injected provider error, × 3 signals). ProviderFailure is a managed supplied-provider seam, not a claim that local CloudFront header resolution can time out.Mutation results
Every mutation was temporary and restored. Both suites passed again after restoration.
/auctionno geo while EC retains geogeo_consent_axumshould export same country: de Purpose1 Auction returning=falsegeo_consent_axumshould gate EC creation: us-ca None Document returning=falsegeo_consent_fastlyshould gate actual bidder dispatch: untrusted None Document returning=falsegeo_consent_axumshould gate EC creation: error None Document returning=falsegeo_consent_axumshould gate EC creation: missing None Document returning=falseAn initial attempt to mutate the generic service-error fallback was not counted: Axum has already converted managed provider errors to
Ok(None)there. The recorded error-default mutation targets the actual managed projection instead.Evidence
9d02d7b3185b49e81d9ac972ca3feef932ed848acontracts and producer tests inspected; upstream tests were not rerun or counted as TS application evidence. No EdgeZero source/pin changes.Targeted local checks
4fe9fe7f6)cargo test-axumcargo test-axum --features geo-cloudfront geo_consentcargo clippy-axum,cargo clippy-fastlycargo fmt --all -- --check, changed test documentation/JSON/launcher formatting75173b1c1e8015cae4aa315593f:cargo test-axum --features geo-cloudfront geo_consentpassed (geo_consent_axum,geo_consent_runtime_axumand both port-retry fixtures); mapped Fastlygeo_consent_fastlyandgeo_consent_fastly_forwardingunder isolated Viceroy 0.21.0 passed (2/2)4fe9fe7f6: READY TO REQUEST REVIEW; 0 blocking, 1 optional, 0 verification blockersRust 1.98.1, Node 24.20.0. The full local CI gate list was deliberately not run; hosted CI owns the remaining gates.
Known response-header expected failure (preserved)
At head
e8015cae4,crates/trusted-server-adapter-fastly/src/middleware.rs:201sets only the unavailable flag when geo is absent. The #1532 deferral reply explicitly preserves this behavior and says no separate follow-up issue was created. Existing issue searches found no dedicated tracker; an issue title/body/repro has been drafted for the requester, not created.Exact probe: unmapped authenticated reader
192.0.2.7, new reader, no consent cookies:Origin response headers:
Actual finalized response headers:
Requiring cleared headers fails at
should report same producer country: missing None Document returning=false, actualDE, expected absent. This is a documented expected failure of the future clearing behavior, not an unexplained ignored test.geo_consent_fastlynow callsverify_deferred_stale_origin_headers, explicitly asserting today's headers with the deferral comment so a future fix fails loudly until that contract is deliberately updated. It also asserts no EC/no bidder without consent and no EC/one bidder with no device geo under effective TCF P1. Both decisions therefore still use Unknown.No consumers of response
x-geo-*headers were found in repository TSJS/CMP/consent/client auction code or Rust integrations. Searches run:The browser response-header read is
content-type(core/auction.ts:202); trace country/region come from report bodies. Didomi writes trusted outbound geo fromservices.geo()(didomi.rs:305,419). This search does not qualify external publisher consumers.Independent review
The full PR was independently reviewed against merge base
8e8a5847fa4f3def31e0deeb1f3be1c95d7caaa4, at head4fe9fe7f6801000a49c889732655e4944a1d41d1. Verdict: READY TO REQUEST REVIEW, with no blocking findings or verification blockers. The PR is ready for review, with three reviewers requested.One optional test-strengthening note remains: the new matrix recognizes cookie deletion through
Max-Age=0and checks retention by cookie name/value plus live record. Sharing the existingIdentityJarexpiry parser would additionally catch a same-value cookie with negative Max-Age or past Expires. The production deletion helper currently emits Max-Age=0, which is covered; this is a test-coverage improvement, not a demonstrated production defect.Remaining #1518 work
ctx.geo()adoption after EdgeZero EdgeZero Integration #480, KV store trait #486 and R3.ctx.geo().Checklist
.envedits69e55dee1,4fe9fe7f6,792d52185,fb9905f3f, merge8aaa84d0c,d077a8634, merge75173b1c1, mergee8015cae4)