Skip to content

Verify geo consent paths on Axum and Fastly - #1659

Open
prk-Jr wants to merge 14 commits into
feat/1592-ja4-ua-contradictionfrom
test/1518-geo-consent-suite
Open

prk-Jr wants to merge 14 commits into
feat/1592-ja4-ua-contradictionfrom
test/1518-geo-consent-suite

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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 NonRegulated and issued an EC without consent. Reject unusable SDK country codes before creating GeoInfo; the same missing-location snapshot then reaches every consumer. Invalid or sentinel subdivisions (?, NO REGION, empty, or anything else failing EdgeZero's SubdivisionCode check) are dropped and the valid country is kept, matching GeoOutcome::platform. This preserves existing consent policy, valid Fastly SDK country/region casing, its local lookup, and the EdgeZero pin 9d02d7b3.

Changes

Area Change
Core test support Shared JSON location table, raw consent/request inputs, adapter exchange contract and independent outcome assertions. Reuse the identity recording store and TCF fixture.
Axum Managed native ingress with real CloudFront selection and actual TS router/finalizer; bind only the record store/outbound double. Request services still derive from ctx.geo(). Separate production-binary process acceptance reuses the startup harness.
Fastly Extend the existing identity runner, preserving production trusted-IP resolution and lookup, holding the same snapshot for finalization and reusing assembled state. Add forwarding controls and the small country-validation correction.
Runtime/CI Generate a test-only Viceroy mapping from the shared table, discover Cargo's exact test artifact, require Viceroy 0.21.0 and both test names, and run it in the existing Fastly CI job.
Test documentation Explain the adapter hook, producer differences, policy assertions, runtime boundaries and N/A/follow-up cases.

Geo surface map

Paths and line numbers in this table describe PR head e8015cae4, relative to crates/. Shared matrix means geo_conformance::geo_consent_axum and identity_conformance::geo_consent_fastly; process acceptance means managed_geo_consumers::geo_consent_runtime_axum.

Surface How it gets geo Adapter(s) Covered by
Axum producer adapter-axum/src/platform.rs:30,43: snapshots private ctx.geo(); only Selected+Located projects country/subdivision; unavailable/untrusted/error/unselected project no location Axum Shared matrix, process acceptance; existing platform::tests::unavailable_outcomes_and_forged_extensions_cannot_supply_geography
Fastly producer adapter-fastly/src/main.rs:397,449; platform.rs:271: resolve client IP, then one RequestGeo::lookup_once; SDK values copied by geo_from_fastly at platform.rs:217 (invalid countries now rejected; invalid/sentinel subdivisions dropped, country kept) Fastly Shared matrix with real Viceroy IP mapping
Trusted reader IP 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:44 resolves before sanitization Fastly geo_consent_fastly_forwarding, shared untrusted row; existing resolver tests
Axum protected provider trust native_geo.rs:96 selects protected provider; actual owned peer must match declared protected CIDR. ALB verifies origin credentials; TS strips the dedicated credential header Axum Shared untrusted/error/off rows; process acceptance; existing startup credential-removal tests
Jurisdiction/config core/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 NonRegulated Both Shared location × signal matrix; targeted consent:: tests
EC context/creation core/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 POST Both Shared matrix; targeted ec:: tests; existing identity conformance
EC GET core/src/ec/app/route.rs:94,117: reads geo/consent but is read-only for EC creation and does not finalize withdrawal Both Shared EC GET rows; existing identity HTTP contract
EC POST core/src/ec/app/route.rs:138,142,159,181: prepares raw consent snapshot, reads request geo, creates and finalizes Both Shared EC POST rows; existing cross-language EC snapshot contract
EC policy core/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 EC Both Shared matrix; targeted consent tests
Withdrawal / ID-1 core/src/consent/mod.rs:602-626: GDPR TCF denial and applicable US opt-outs withdraw; Unknown/NonRegulated do not. ec/finalize.rs:686,696 requires explicit withdrawal plus received EC. ec/mod.rs:395,469 retains an existing identity Both Shared returning matrix checks cookie expiration and record liveness; targeted EC tests
Publisher HTML SSAT core/src/publisher.rs:4552,4616,5015,5738: uses EC context geo and consent for admission and auction device Both Shared document rows with enabled HTML slot and captured bidder
Page bids core/src/publisher.rs:7316,7321,7451: uses same EC geo/consent gate Both Existing targeted auction/publisher and identity HTTP tests; no new page-bids matrix lane
/auction core/src/auction/endpoints.rs:295,395: admission reads EC consent; device builder separately calls the geo service Both Shared endpoint rows; process acceptance; divergent-geo mutation
Standard/PBS OpenRTB core/src/auction/openrtb.rs:394,662-704: copies country/region and forwards GDPR/GPP/section/US Privacy fields from consent Both Captured OpenRTB assertions in shared matrix; targeted auction:: tests
Legacy Prebid / APS core/src/integrations/prebid.rs:2949,3092; aps.rs:1162: serializes supplied country/region and privacy fields Both Existing serialization tests; shared matrix configures standard OpenRTB, not these protocols
EC record / provider exclusions core/src/ec/kv_types.rs:687,960; ec/finalize.rs:531; ec/registry.rs:91; ec/coordinator/mod.rs:470 Both Shared record-liveness checks; targeted ec:: tests
Response geo headers core/src/geo.rs:27; Axum middleware.rs:146 clears stale geo; Fastly middleware.rs:196,201 applies held geo or unavailable flag Both Shared header assertions; separate stale-origin probe described below
Didomi core/src/integrations/didomi.rs:160,305,419 independently reads geo service; canonicalizes trusted country/subdivision, never takes caller geo as authority Both 38 targeted Didomi tests, including unavailable/invalid/caller-forged controls; not a new runtime matrix lane
Other integration filters core/src/integrations/registry.rs:341,421,983; DataDome protection.rs:156 receives held geo/ASN Both Existing core integration tests/source inspection; no new enabled-DataDome runtime qualification
Trace Fastly app.rs:1331 reads RequestGeo; Axum app.rs:886 reads fixed services only in explicit-service routers, otherwise pre-dispatch metadata has no geo. Document trace uses EC geo at core publisher.rs:5614,5853; projections at trace/context.rs:48 Both Existing trace tests and source inspection; no new trace runtime claim
Telemetry/logs core/src/auction/telemetry.rs:177; consent/mod.rs:647,688; ec/mod.rs:416,475; publisher.rs:4632 use request context country/region/jurisdiction Both Targeted core auction/consent/EC tests and source inspection; logs are not substituted for bidder evidence

Fastly makes one host geo lookup per request; its RequestGeo answers repeat service calls from that held result and only for the resolved IP. Axum resolves the managed provider once and AxumPlatformGeo clones 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.

Cases Axum Fastly
DE, GB, US-CA, US-WY, US without subdivision, JP Pass Pass
Country only; region without country; no location Pass Pass (region-only raw SDK record has empty country and is rejected)
Empty, XX, overlong, non-ASCII, unassigned/aggregate (XK, EU, AP, A1, A2, O1) country Pass Pass after producer correction: country rejected, so no location reaches consumers
Invalid/sentinel subdivision (?, NO REGION, empty, US-CA) with a valid country Pass: protected CloudFront provider rejects the whole assertion, so Unknown Pass after producer correction: subdivision dropped via SubdivisionCode, country kept (DE stays GDPR; US is country-only NonRegulated)
Lowercase country/subdivision Pass: us/ca → US/CA before consumers Pass: valid SDK casing retained; case-insensitive policy selects US-CA consistently
Unavailable, untrusted/forged, provider error Pass Pass (lookup error uses existing explicit test hook)
Geo unconfigured/unselected Pass N/A: local Fastly lookup has no provider selector; no-match/error cover its absence paths
Authenticated IPv4/IPv6; forged, duplicate, malformed, unauthenticated IP source Protected-peer trust pass Pass; rejected input follows actual peer, not supplied reader IP
New/returning document, EC POST, SSAT, /auction, assets/APIs Pass Pass
EC GET Pass: read-only, creates no EC; does not finalize withdrawal Same
Unknown + effective TCF P1 No new EC; bidder receives request Same
Unknown without P1 No new EC; no bidder dispatch Same
Returning Unknown/NonRegulated with denied signals Cookie retained and authoritative record live Same
Applicable GDPR/US withdrawal Cookie expires and record tombstoned on finalized paths Same
API/KV timeout N/A: synchronous local provider headers N/A: synchronous local host lookup

There 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.

Mutation Rejected by Actual failing assertion/case
Give /auction no geo while EC retains geo geo_consent_axum should export same country: de Purpose1 Auction returning=false
Drop US subdivision during conversion geo_consent_axum should gate EC creation: us-ca None Document returning=false
Accept forged Fastly authentication geo_consent_fastly should gate actual bidder dispatch: untrusted None Document returning=false
Map managed ProviderFailure to JP geo_consent_axum should gate EC creation: error None Document returning=false
Let Unknown create EC geo_consent_axum should gate EC creation: missing None Document returning=false

An 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

  1. EdgeZero upstream: pinned 9d02d7b3185b49e81d9ac972ca3feef932ed848a contracts and producer tests inspected; upstream tests were not rerun or counted as TS application evidence. No EdgeZero source/pin changes.
  2. TS application paths: shared matrix through real router/middleware/finalization on both adapters; raw request consent parsing, capturing bidder transport and record store. Record liveness is explicitly an internal storage observation because response cookie retention cannot prove a live backend row.
  3. Runtime acceptance: isolated Viceroy 0.21.0, actual Fastly geo hostcalls with generated documentation-IP mapping, plus production Axum child processes with real protected/untrusted/off profiles and real HTTP bidder capture. Original identity runtime harnesses reused; no live cloud qualification claimed.

Targeted local checks

  • Core consent (123), EC (693), auction (326), geo (10), Didomi (38), trace-context (7) tests (counts at 4fe9fe7f6)
  • cargo test-axum
  • cargo test-axum --features geo-cloudfront geo_consent
  • Fastly adapter tests under isolated Viceroy 0.21.0 (239 passed; 8 prerequisite-gated tests ignored, including the two geo tests executed separately below)
  • Mapped Fastly geo matrix and forwarding controls (both prerequisite-gated tests explicitly executed by launcher)
  • Integration parity (33)
  • cargo clippy-axum, cargo clippy-fastly
  • cargo fmt --all -- --check, changed test documentation/JSON/launcher formatting
  • Hosted CI: all 29 checks pass on the previous head 75173b1c1
  • Hosted CI on e8015cae4
  • After merging Run Axum identity through the shared application #1646 at aa315593f: cargo test-axum --features geo-cloudfront geo_consent passed (geo_consent_axum, geo_consent_runtime_axum and both port-retry fixtures); mapped Fastly geo_consent_fastly and geo_consent_fastly_forwarding under isolated Viceroy 0.21.0 passed (2/2)
  • Independent full merge-base self-review at 4fe9fe7f6: READY TO REQUEST REVIEW; 0 blocking, 1 optional, 0 verification blockers

Rust 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:201 sets 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:

GET /article HTTP/1.1
Host: publisher.example.com
User-Agent: Mozilla/5.0 AppleWebKit/537.36 Chrome/146.0.0.0 Safari/537.36
Cookie:
Origin: https://publisher.example.com
Content-Type: application/json
Sec-Fetch-Site: same-origin
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Accept: text/html
x-example-reader-ip: 192.0.2.7
x-example-reader-auth: fictional-shared-secret-0123456789

Origin response headers:

HTTP/1.1 200 OK
Content-Type: text/html
x-geo-country: DE
x-geo-region: BE

Actual finalized response headers:

HTTP/1.1 200 OK
x-geo-info-available: false
x-geo-country: DE
x-geo-region: BE

Requiring cleared headers fails at should report same producer country: missing None Document returning=false, actual DE, expected absent. This is a documented expected failure of the future clearing behavior, not an unexplained ignored test. geo_consent_fastly now calls verify_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:

rg -n -i 'x[-_]geo|geo[-_]info[-_]available|headers\.(get|getAll|has)|getResponseHeader|getAllResponseHeaders' crates/trusted-server-js/lib/src
rg -n -i 'geo|jurisdiction|country|region' crates/trusted-server-js/lib/src
rg -n -i 'x[-_]geo|geo[-_]info[-_]available' crates/trusted-server-core/src/integrations crates/trusted-server-core/src/consent crates/trusted-server-core/src/auction

The browser response-header read is content-type (core/auction.ts:202); trace country/region come from report bodies. Didomi writes trusted outbound geo from services.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 head 4fe9fe7f6801000a49c889732655e4944a1d41d1. 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=0 and checks retention by cookie name/value plus live record. Sharing the existing IdentityJar expiry 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

  • Cloudflare and Spin ctx.geo() adoption after EdgeZero EdgeZero Integration #480, KV store trait #486 and R3.
  • Run the shared suite and shipping-runtime acceptance on both adapters.
  • API/KV failure, timeout and remote-provider cases.
  • Operator documentation for provider selection, capabilities, bindings and trusted reader-IP provenance.
  • Aram's decision on whether Fastly should move to ctx.geo().

Checklist

@prk-Jr prk-Jr self-assigned this Nov 24, 2026
@prk-Jr prk-Jr linked an issue Nov 24, 2026 that may be closed by this pull request
7 tasks
@prk-Jr
prk-Jr marked this pull request as ready for review November 24, 2026 15:13
prk-Jr and others added 2 commits November 25, 2026 15:29
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.
@aram356
aram356 changed the base branch from feat/1574-axum-shared-identity to feat/1592-ja4-ua-contradiction November 25, 2026 20:11
aram356 added a commit that referenced this pull request Nov 25, 2026
#1659 (c4d2ce7) now sits on #1661 and resolves its Fastly conformance
fixture conflict with #1661's JA4 middleware in its own merge. The merge is
clean.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed c4d2ce72a, a merge of #1661's new head fb7793a0e onto this PR's e8015cae4. This PR now stacks on #1661 instead of #1646, so rc/identity can take both as plain merges, and the merge also brings #1626, #1656, #1661 and #1636, #1646's 4f4c03689, 71a573a08 and new merge b5a5f62f8, which strips the mirrored UID's exp in the identity conformance check, and #1506's repin of EdgeZero to rc/identity at d063a8e7 with main's Fastly SDK upgrade (#1671). Resolutions:

I changed the base to feat/1592-ja4-ua-contradiction (#1661).

#1661's new head b33c45b brings #1537's b181544, "Accept any Fastly EC
store link name at startup", which #1537's owner merged up through #1539,
#1538 and #1540. The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1659 (2362e1e) carries #1537's b181544, "Accept any Fastly EC store link
name at startup", through the chain below it. The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 2362e1e7c, a merge of #1661's new head b33c45b39. It brings #1537's b181544a0, "Accept any Fastly EC store link name at startup", which #1537's owner merged up through #1539, #1538 and #1540. The merge had no conflicts.

Takes #1661's new head 62543b0, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1659 (20a0e55) carries #1506's repin of EdgeZero to rc/identity at
459bd27d (42e0c46), with PR 275 at 0e2a58ae, the stack's test fixes and
EdgeZero 536's bounded record update, RecordHandle::update, through the
chain below it. The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 20a0e558f, a merge of #1661's new head 62543b0f7, which brings #1506's repin of EdgeZero to rc/identity at 459bd27d (42e0c46c7): EdgeZero #275 at 0e2a58ae, the EdgeZero stack's test fixes and EdgeZero #536's bounded record update, RecordHandle::update. The merge had no conflicts.

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.
#1661's new head 2e0bbb0 brings #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1659 (b72b5e8) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq" and #1659's own 0c887ac, "Name the accepting geo consent fixture by its role". The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 0c887aceb, "Name the accepting geo consent fixture by its role": geo_consent_runtime_axum's server whose trusted proxy range covers the test client is now accepted rather than trusted, beside untrusted and unselected. The test passes locally with geo-cloudfront, and clippy is clean. Then b72b5e875 merges #1661's new head 2e0bbb0cb, which brings #1539's cf4e815d4, the native container test's failure-router expectation, and #1646's a18abf428, the reworked KV check in the store metadata test. The merge had no conflicts.

@dhruv8sh dhruv8sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_fastly now returns None for countries outside EdgeZero's list of ISO-assigned codes (for example XK, EU, A1, O1). It also drops subdivisions that fail SubdivisionCode validation (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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 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.

Takes #1661's new head 5d951a7, which carries #1506's repin of EdgeZero to
rc/identity at 1619078a (8edc50e), a revert that removes EdgeZero 522
(portable Fastly record providers) and 524 (outbound mTLS client
identities).

The merge is clean.
aram356 added a commit that referenced this pull request Nov 27, 2026
#1659 (ba66774) carries #1506's repin of EdgeZero to rc/identity at
1619078a (8edc50e), a revert that removes EdgeZero 522 (portable Fastly
record providers) and 524 (outbound mTLS client identities), through the
chain below it. The merge is clean.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed ba66774e5.

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 ChristianPavilonis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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())),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify EdgeZero geolocation adoption in EC and auction consent paths

4 participants