Skip to content

Enforce provider opt-outs and legacy EID expiry on Fastly and Axum - #1626

Open
prk-Jr wants to merge 46 commits into
feat/1574-axum-shared-identityfrom
fix/1555-provider-eid-opt-outs
Open

prk-Jr wants to merge 46 commits into
feat/1574-axum-shared-identityfrom
fix/1555-provider-eid-opt-outs

Conversation

@prk-Jr

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

Copy link
Copy Markdown
Collaborator

Summary

Enforce remembered provider opt-outs consistently across stored identity records, carried browser cookies, mirrors and direct/initial-page/page-bids auctions. Expired legacy SharedID records no longer defeat a valid cookie or return through response writeback. Live provider-written records and unowned sources retain their existing behavior.

Revision status, checked 2026-12-03 12:13 UTC: the maintainer advanced this PR to 186c6a408f, with base feat/1574-axum-shared-identity at b06dcbd0ee0ba9bc8e48523b4084076c50d4796c and EdgeZero ef5cbf308. Earlier signed review correction 3ffa7d9705 remains in its history. Local/runtime and hosted results below are historical for their named revisions; they do not qualify this later SDK merge. Exact-head CI reports 30 contexts (30 QUEUED); full current-head qualification is assessed separately.

Closes #1555.

Review corrections

  • Use one stored-record eligibility policy for read paths and SharedID writeback. An enabled owner makes legacy singles ineligible at read time; live provider-written records retain their expiry semantics. Existing valid provider cookies can opt back in at a successful timed navigation commit.
  • Keep exactly one typed optional owner per exact source, independently of vendor-consent gates. SharedID's two legal source aliases consult both owners' remembered opt-outs; tests use configurations startup actually accepts.
  • Enforce matching-row remembered opt-outs on carried mirrors even on non-navigation requests with no client EIDs. An enabled owner's memory remains authoritative when current bidstream/mirror delivery flags are off. Disabling the owner, unrelated sources and unmatched rows preserve their existing behavior.
  • Expire only configured carried SharedID cookie(s) and their companion when matching owner memory forbids writeback. Generic browser IDs cannot clear that memory; unrelated publisher/provider cookie names are preserved.
  • Pass the finalizer's authoritative checked time into writeback without retrying a failed clock. EC GET and relevant non-navigation mirror cleanup obtain time lazily after matching-row/owner relevance is established. Clock failure suppresses positive writeback and conservatively expires only the relevant carried managed cookies/mirror, including failed navigation time without retry; ordinary absent, unrelated and disabled-owner paths acquire no new clock. No new KV reads or row deletion are introduced.
  • Replace duplicate helper-loop coverage with honest shared-helper coverage plus actual /auction, initial-page and page-bids lifecycle tests. Rename the matching-row client policy helper, reuse the existing EC response-cookie parser and keep the design's Review log last.
  • Add a native HTTPS acceptance case using a generated local CA, actual ID5 response decoding, persisted opt-out inspection and later cookie-free auction controls. Fix an inherited test server's single-read/nonblocking handling so it waits for complete request headers under the existing timeout; application drain behavior is unchanged.

Stack

At the original correction’s qualification, the GitHub base was feat/1574-axum-shared-identity at 0070304f9a8cfe76d08b07c194d267dae78d0498. The later maintainer source/base identities are recorded above. This follows the shared identity/prepared-native-startup stack; no branch retarget, rebase or dependency merge is part of these review corrections. Removed adapter-local identity/store code stays removed. A later forward merge into #1656 must preserve its rejected-browser no-read/no-write guard, including EC GET.

Validation

Review correction commit: 3ffa7d9705e1243a52ed07b03c4784da7e35d230.

  • All 21 repository local gate groups pass, including all five adapter test modes, eight target-matched clippy aliases, parity, native digest tests/lint, full JS build/lint/format and 3,373 tests, documentation lint/format/build, domain and runtime-environment guards, release/helper scripts, Fastly/Worker deadline fixtures and four fresh production health/startup smokes.
  • Applicable HTML EOF harness test/lint and actual Axum/Fastly EOF/auction controls pass. Additional identity conformance, proxy-policy and CLI checks pass.
  • Native geo-cloudfront acceptance on macOS: 14 passed, two ignored (Linux-only process-local TLS case and the existing external real-Next.js fixture); its full adapter lint passes. The carried mirror copy has a valid future UID expiry, and actual navigation finalizer regressions cover failed authoritative time, provided-time active/equality/expired policy and unrelated/disabled/mismatched preservation.
  • Local production Fastly release WASM under pinned Viceroy 0.22.0: an untrusted CA yields no HTTP provider response or remembered opt-out; process-local trust permits one actual HTTPS ID5 200/universal_uid: "0" response, followed by a persisted deadline and four later direct/initial/page-bids controls that suppress owned IDs and preserve unrelated IDs. No SDK selector, JA4 gate or system trust setting was bypassed.
  • Local Linux ARM64 (aarch64-unknown-linux-gnu) exact native HTTPS acceptance: one passed, zero failed/ignored, in an isolated container with --network none. Rust 1.98.1/Node 24.20.0 were verified before Cargo, source/prebuilt JS were readonly, the normal geo-enabled app was built last and verified to exclude core test-utils, and app/harness hashes were checked before execution. The untrusted/trusted CA arms establish actual provider response decoding, persisted memory and later mirror-only/explicit-body auction enforcement. This is a local normal-profile binary, not an x86 or release-image claim.

Failures from earlier qualification attempts remain distinguished from this final fresh-source run: an existing dropped-port reservation collision passed on the unchanged serialized Axum suite; the unchanged Cloudflare deadline suite passed in a quiet retry after an earlier timeout (cause not established). A private Fastly fixture initially supplied incomplete geolocation data and correctly failed consent closed; completing the SDK-required fixture data established the positive input path without changing production code or guards.

All 34 hosted checks pass on 3ffa7d9705e1243a52ed07b03c4784da7e35d230. New-head hosted results are separate from the local runtime evidence above. Runtime results are local fixtures, not live-provider, deployed-edge, real-browser or Linux x86 qualification. No historical author-reported HTTPS/artifact receipt is claimed as newly executed evidence.

Spec

Bug fix without a configuration or persisted-schema migration. Opt-outs remain active strictly before their deadline; exact deadline equality is expired. Missing, failed or mismatched snapshots retain existing degraded behavior. Legacy suppression is read-time policy, and rollback can resume old singles.

Design and plan.

Axum now builds the partner registry and both provider coordinators at startup, reads and mints ts-ec on publisher navigations, runs page-phase lookups through Axum's HTTP client, and finalizes through KvIdentityGraph with a single page-load write. After-response providers run on a spawned blocking task with their follow-up compare-and-swap write. The identity graph is a process-local store with generation-based CAS, enabled when ec.ec_store is set.

Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
@prk-Jr prk-Jr self-assigned this Nov 18, 2026
@prk-Jr prk-Jr linked an issue Nov 18, 2026 that may be closed by this pull request
3 tasks
@prk-Jr prk-Jr changed the title Enforce provider opt-outs for client and legacy EIDs Enforce provider opt-outs and legacy EID expiry on Fastly and Axum Nov 18, 2026
@prk-Jr
prk-Jr changed the base branch from feat/s2s-eid-vendors to feat/axum-identity-providers November 18, 2026 15:19
@prk-Jr
prk-Jr force-pushed the fix/1555-provider-eid-opt-outs branch from 7ac8b5e to ee7a110 Compare November 18, 2026 15:19
@prk-Jr
prk-Jr added this pull request to stack #1629 November 18, 2026 16:25
@dhruv8sh
dhruv8sh removed this pull request from stack #1629 November 20, 2026 01:58
@prk-Jr
prk-Jr changed the base branch from feat/axum-identity-providers to feat/1574-axum-shared-identity November 20, 2026 09:49
@prk-Jr
prk-Jr added this pull request to stack #1649 November 20, 2026 09:50
@prk-Jr
prk-Jr marked this pull request as ready for review November 20, 2026 10:24
PR #1646's new head brings its identity consent and delivery boundary enforcement, plus the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536, #1535, #1537 and #1538.

crates/trusted-server-core/src/ec/app/route.rs: #1646 moved the EC route's after-response scheduling into a finalized callback so Fastly can hand the work off after delivery, and #1636 made schedule_after_response return whether the work registered. The resolution keeps #1646's callback, and the native ec_route callback keeps #1636's handling of the must_use result.
PR #1636's new head brings the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536, #1535, #1537, #1538 and #1646.

crates/trusted-server-core/src/auction/endpoints.rs: #1646 replaced the inline SharedID opt-out cookie check with sharedid_opted_out, and #1626 passes the KV snapshot to drop_vendor_denied_client_eids. The resolution keeps #1626's call and #1646's helper.

crates/trusted-server-core/src/publisher.rs (merged clean, did not compile): #1626's provider opt-out test builds AuctionEidTargeting without the sharedid_opted_out field that #1646 added. The resolution sets it to false, like the module's other tests.
PR #1646's new head brings wave B: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806, carried up through the chain. The merge is clean. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
PR #1636's new head brings wave B: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806, carried up through the chain. The merge is clean. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
@aram356

aram356 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Round 12 identity realignment: rc/identity is now at db7dce634, and EdgeZero is pinned to its rc/identity at 8a73c097. This branch fast-forwarded from 8ea87b7ce to 6d0a8fd67:

Each merge message says what it carries and how any conflict was resolved.

aram356 and others added 8 commits December 1, 2026 18:27
PR #1646's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
PR #1636's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
PR #1646's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
PR #1636's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
Share stored-record eligibility with SharedID writeback so expired legacy
singles cannot defeat valid cookies or return through response headers.
Represent exact-source ownership with one typed optional owner and retain
vendor gates separately.

Expire carried managed cookies and mirrors when matching enabled-owner
memory applies, including mirror-only non-navigation requests and failed
authoritative navigation time. Reuse checked finalizer time without
retrying failure; acquire time lazily only for relevant EC GET or
non-navigation policy. Preserve unrelated sources,
disabled owners, unmatched rows, opt-back-in and existing KV read counts.

Cover actual auction/page-bids/finalizer callers, add isolated HTTPS
provider-produced memory acceptance, and make the native drain fixture wait
for complete headers from nonblocking accepted sockets. Reconcile the
provider policy, clock contract and qualification documentation.
PR #1646's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage and #1535's Sourcepoint consent mirror deduplication and consent update coverage. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
PR #1636's new head brings #1636's stronger after-response body and drain checks, plus #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage and #1535's Sourcepoint consent mirror deduplication and consent update coverage.

crates/trusted-server-adapter-axum/tests/native_acceptance.rs: #1635's owner commit fb7fc9b moved connected_to_listener into the shared listener fixture module and renamed Running::assert_logs_hold_no_secrets to stop_and_assert_no_secret_logs. #1626's owner commit 3ffa7d9 added the geo-cloudfront https_provider fixture module and narrowed the base64 imports. The resolution keeps both modules and #1626's imports with #1635's listener import. #1626's four geo-cloudfront tests still called the old method name, which only an all-features build compiles, so they now call stop_and_assert_no_secret_logs; the method behaves the same.

crates/trusted-server-adapter-axum/src/after_response_drain_tests.rs (semantic fix): #1636's owner commit d5a5ae1 and #1626's 3ffa7d9 each added read_probe_headers and the probe_waits_for_complete_fragmented_headers test at different places, so the clean text merge defined both twice. The resolution keeps #1636's later version, which also checks the partial request with peek, and drops #1626's copies. The file now matches #1636's.

Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
@aram356
aram356 removed this pull request from stack #1665 December 3, 2026 11:34
@aram356
aram356 added this pull request to stack #1731 December 3, 2026 11:35
aram356 added a commit that referenced this pull request Dec 3, 2026
PR #1675's new head brings #1675's switches that turn off POST /auction while the auction is disabled and the first-party creative endpoints while creative rewriting is off, together with the identity chain between #1646 and #1675 that #1667 did not carry yet: #1636's Axum after-response drain on SIGTERM, #1626's provider opt-outs and legacy EID expiry on Fastly and Axum, #1656's configurable Edge Cookie browser gate, #1661's refusal of EC creation when a trusted JA4 contradicts the User-Agent, and #1662's Fastly EC route acceptance and capped mirrored expiry.

docs/guide/configuration.md: #1675 reworded the enabled row of the [auction] table to say that it also turns on POST /auction, and #1667 added the mtls_slot row, which widened the table. The resolution keeps #1675's enabled text and #1667's mtls_slot row, with the table reformatted by Prettier.

Semantic break in crates/trusted-server-core/src/integrations/prebid.rs: #1675's owner commit d141923 added a test plan with no browser routes, whose ProviderConfig and AuctionPlanConfig literals predate #1667's 0985d67, which added the mtls provider field, and eaa2b3e, which added the mtls_slot plan field. The merge applies cleanly but the core tests no longer compile. The fix belongs in this link because it is where the two changes first meet. The literal gains mtls: false and mtls_slot: Default::default(), as #1667 wrote in the neighboring prebid.rs literals.

Cargo.lock is unchanged.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 15 identity realignment: rc/identity is now at 391a08578, and EdgeZero is pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 3ffa7d970 to 186c6a408:

This round's link keeps #1636's read_probe_headers and its test, which this PR's 3ffa7d970 also added, so each is defined once. It also fixes four geo-cloudfront startup tests whose helper call no longer compiled after the merge. Only an all-features build compiles those tests.

Each merge message says what it carries and how any conflict was resolved.

@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Request on the native HTTPS provider fixture (crates/trusted-server-adapter-axum/tests/fixtures/native/https_provider.py and https_provider.rs, from 3ffa7d970): please replace the Python server and the openssl calls with Rust test code.

https_provider.rs runs openssl to make the fixture certificates and python3 https_provider.py to serve HTTPS, so cargo test-axum on this branch needs both on the host. Neither is in .tool-versions, and the project keeps HTTP test fixtures for server components in Rust, not Python or JavaScript.

The workspace already has what a Rust fixture needs. rcgen 0.13 can make the CA and the leaf certificate, and rustls 0.23, tokio-rustls 0.26 and hyper 1 can serve TLS. The CLI's dev-dependencies already use the same set. An in-process server on a 127.0.0.1:0 listener could keep the current receipts (handshakes.jsonl, requests.jsonl, responses.jsonl) and the ca_file() contract. It would also drop the child process, the ready.json polling and the PATH passthrough.

Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Cascade of #1533's Axum startup-test port fix (779e44673): b0728c11b merges it into this PR. There were no conflicts and nothing else changed. The fix moves free_loopback_port in crates/trusted-server-adapter-axum/tests/routes.rs below the ephemeral port range, and #1533's note has the details. Owner commits pushed to other chain PRs since round 15 come in with the next round. rc/identity is now 62f8e41e2.

@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Merged #1627's runtime KV removal (7c2b84f45) into this branch as cfcb5dffb, on top of b0728c11b.

At the maintainer's request, that commit removes the generic runtime KV store trusted_server_runtime_kv. Nothing reads or writes it, and the managed Fastly deploy made every service provision and pay for it. edgezero.toml and the Fastly Hooks::stores() now declare only trusted_server_kv, and RuntimeServices::kv_store() is unavailable on every adapter.

Only that commit was merged, not the base branch's new head. Conflicts were resolved in edgezero.toml, the Fastly Hooks::stores() in app.rs, fastly.toml, the Viceroy template, the integration tests' config.rs, trusted-server.example.toml, docs/guide/architecture.md and docs/guide/edgezero.md. Only trusted_server_kv stays declared, this branch's record-store comment and local seeds are kept, and the runtime-KV lines are dropped. The Axum README and docs/guide/axum-dev.md keep this branch's Axum wording.

Checks on this head: no reference to the removed store remains and cargo fmt --check passes; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. rc/identity (b9dc3153e) passed the full CI gate list with the removal.

PR #1646's new head brings its fix that preserves filter headers through identity finalization, plus #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in. The merge is clean.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 17 identity realignment: rc/identity is now at 0ed862633, and EdgeZero stays pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from cfcb5dffb to 1ad8ba4c7:

Each merge message says what it carries and how any conflict was resolved.

@prk-Jr prk-Jr mentioned this pull request Dec 4, 2026
13 tasks done
@jevansnyc jevansnyc mentioned this pull request Dec 4, 2026
9 of 15 tasks
@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as 9d8d4aced, on top of 1ad8ba4c7.

Trusted Server owns the /_ts/ namespace (#1740). A request for /_ts or any /_ts/ path that no route handles now gets a local 404 on Fastly, Axum, Cloudflare and Spin, and never reaches the publisher origin. The path is matched after percent-decoding. Paths outside the namespace, such as /_tsx or /articles/_ts/x, still go to the publisher origin, and every routed /_ts/ path answers as before.

This merge takes #1646's new head (72cc0ad35), which carries 48930c270 and nothing else new to this branch. It was clean.

Checks on this head: no conflict markers; cargo fmt --all -- --check passes; the merge adds exactly #1614's change to this branch's files; it merges cleanly with every lower head in its stack. rc/identity (e72407155) passed the full CI gate list with the change.

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.

Client and browser EIDs for provider-owned sources after a provider opt-out

4 participants