Skip to content

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

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

prk-Jr wants to merge 30 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 on client cookie/body EIDs across Fastly and Axum direct, initial-page and page-bids auctions, preserving unrelated IDs and opt-back-in.
  • Immediately expire legacy browser single-UID records while an enabled provider owns their emitted source. Preserve live provider UID expiry and no-provider behavior.
  • Refresh onto Run Axum identity through the shared application #1646's shared identity application and prepared native record startup. Do not restore removed adapter-local identity/store code.

Stack and refresh

Base: feat/1574-axum-shared-identity (#1646), current head aa315593f ("Gate identity writes for rejected clients"). This PR's head is d07f789a4: signed merge 909699dbc of aa315593f, then the mirror fix below. The previous head was 5022efafe.

Two teammate merges of #1646 landed on this branch since the last refresh, both GitHub Verified:

Signed merge 909699dbc brings aa315593f. Git reported no conflicts. One test call site in auction/endpoints.rs (this PR's cookie/body opt-out delivery test) still used the old handle_auction arguments; it now passes AuctionIdentity with persist_body: true, which keeps its previous write behavior. Earlier refreshes were signed merges d72c8bb37 and 48776eba0. No dependency branch was modified.

Whenever #1646 changes during review, merge its new head into this branch and revalidate the affected behavior before readiness.

Current trial merges conflict with #1627 in store documentation/configuration, #1616 in Fastly post-delivery tests, and #1617/#1615 in startup/health/finalization. Preserve the shared lifecycle and the stated runtime qualification limits when resolving those integrations.

Merge resolutions

Conflict Resolution
Cargo.lock Retain #1646's dependency graph.
Axum Cargo.toml Retain current prepared-startup and provider dependencies.
Axum app.rs Retain shared IdentityApp lifecycle and prepared record binding.
Axum lib.rs Keep removed adapter-local identity/store modules absent.
Axum middleware.rs Retain managed geo and current response finalization.
Fastly app.rs Retain shared lifecycle delegation; discard obsolete policy-only graph machinery.
CLI checked_app_config.rs Retain current supported-adapter validation.
Core auction/endpoints.rs Add matching-row remembered opt-outs to current vendor/cookie checks; preserve SharedID filtering and body ingestion.
Core ec/eids.rs Combine remembered opt-outs and immediate legacy expiry with current canonical SharedID output.
Core ec/identify.rs Apply the same stored-record policy alongside consent/cookie checks.
Core ec/pull_sync.rs Keep deleted; provider orchestration remains in the shared application.
Core publisher.rs Supply the current snapshot to client filtering; retain current origin handling.
api-reference.md Retain current endpoint support descriptions.
axum-dev.md Retain prepared startup, persistent records and protected geo guidance.
configuration.md Preserve current activation guidance and document the read policy.

Removed Axum identity.rs, ec_kv.rs and their obsolete test module stay removed. The former EC policy-only flag is also unnecessary: #1646 deliberately keeps the configured record graph available without recognized fingerprint metadata.

Changes

Area Change
Core ownership Retain enabled owner IDs and consult only the matching EC row's active opt-outs. SharedID read policy checks both normalized aliases (pubcid.org and sharedid.org), closing opposite-alias/trailing-dot bypasses. Existing source-specific consent and write ownership remain unchanged.
Core egress Filter direct/publisher/page-bids client IDs and stored EIDs; apply the same legacy expiry and opt-out policy to identify and admin preview. No schema migration or extra write is introduced.
Core mirror build_mirror also withholds a source while any enabled owner has an active remembered opt-out in the row, as KvEntry::live_eids does. Before, when provider A had opted out and provider B, which owns the same source, then wrote a UID, the bidstream, /identify and admin preview withheld it, but __Host-ts-eids-mirror still carried it, and identity-mode Prebid (#1622) merged it. Unit test covers two owners, A opted out and B written, before and after A's opt-out lapses.
Axum acceptance Replace the former adapter-local setup with a real executable subprocess using prepared config/secret stores and persistent records. Exercise positive delivery, repeated cookie/body suppression, unrelated IDs and cookie opt-back-in.
Documentation Update the supporting spec/plan, provider guidance and example-configuration comments for the shared lifecycle, persistent records, geo and current stack.

All #1555 acceptance criteria are implemented here. Shared lifecycle/provider activation belongs to #1646, write-back to #1624, record binding to #1641, prepared startup to #1635, conformance coverage to #1613, and the environment guard to #1637.

Closes

Closes #1555

Spec

Not a feature: bug fix, with no configuration or persisted-schema change.

Design and plan.

An opt-out applies while its deadline is strictly greater than the request time and an enabled owner claims the source. Client EIDs cannot clear active memory. Missing, failed or mismatched snapshots retain existing degraded behavior. Legacy expiry is read-time suppression; rollback can resume serving old singles.

Geo and native startup

Axum production verification uses geo-cloudfront, prepared config/secret stores, isolated persistent records, an admitted loopback peer, the existing protected-origin credential/header mechanism, checked forwarding metadata and country AU, following the native acceptance setup. Geo selection uses supported EdgeZero startup options. No runtime environment reads were added, and the legacy TRUSTED_SERVER_CONFIG_* / TRUSTED_SERVER_SECRET_* bridge is not used for feature activation.

The default geo-off configuration still has unknown jurisdiction and fails identity use closed. The earlier claim that the native executable has no usable geo capability is obsolete: the configured protected-country production path now runs successfully. Migration of the pre-existing narrowly guarded geo profile compatibility input remains owned by #1529/#1532.

Test plan

Local checks on the refreshed tree (merge of aa315593f plus the mirror fix), Rust 1.98.1 and isolated stock Viceroy 0.21.0:

  • New mirror test fails without the fix (mirror set while live_eids withholds) and passes with it.
  • cargo test-fastly: 247 adapter tests and 3,789 core tests passed.
  • Core library natively: 3,803 passed.
  • cargo test-axum and cargo test-axum --features geo-cloudfront, including prepared_provider_opt_out_filters_cookie_and_body_on_repeated_visits.
  • cargo clippy-fastly, cargo clippy-axum, cargo fmt --all -- --check, cargo check-cloudflare, cargo check-spin.
  • Not run locally: cargo test-fastly-reuse, cross-adapter parity, EOF runtime controls and the bidder-capture runtimes; hosted CI covers the gated ones.

The checks below are historical, from earlier refreshes.

Historical author-reported local checks passed on the merged source tree committed as d72c8bb37; the original local logs/browser receipts and artifact bytes are not linked and remain independently unverifiable; Rust 1.98.1, Node 24.20.0 and isolated stock Viceroy 0.21.0. Release artifacts omit debug symbols.

  • cargo test-fastly: 239 adapter tests and 3,781 core tests passed; provider/JS/OpenRTB and documentation tests also passed.
  • cargo test-fastly-reuse: 239 adapter tests passed.
  • cargo test-axum --features geo-cloudfront: 119 tests passed, including the new prepared-store executable regression.
  • cargo clippy-fastly and cargo clippy-axum.
  • Identity guard: 9 passed. Cross-adapter parity: 33 passed.
  • Runtime environment guard compiler fixtures: 52 passed.
  • Rust format, changed documentation format and URL-host lint against the new base.
  • HTML EOF harness: 16 passed; harness lint passed. Real Axum and Fastly EOF/auction controls passed, including Fastly streaming.
  • 28 bidder-capture scenarios on each refreshed production runtime: positive delivery, no-provider cookie/body controls, legacy browser expiry on all three auction paths, real cookie opt-out across repeated visits, seeded remembered-policy enforcement with the cookie absent, unrelated-ID preservation, and real new-provider-cookie opt-back-in.
  • 14 pre-refresh Fastly bidder-capture controls on ee7a11031: no-provider cookie/body/initial/page-bids, repeated remembered-policy suppression and expired-memory delivery. Its strict JA4 gate under stock Viceroy prevents qualifying creation/provider transitions or positive stored-ID enrichment; those controls are not claimed.
  • Hosted CI on d72c8bb37: all 29 checks and all six workflows completed successfully. No failures or reruns.

Remembered server state is explicitly fixture-seeded: native uses a typed KvEntry, the production record adapter and exact-generation conditional write while the process is stopped; Fastly uses equivalent valid manifest state. Subsequent reads, filtering and cookie opt-back-in execute the normal release binaries. These results do not establish an HTTPS vendor response creating that memory, live-vendor behavior, deployed-edge behavior or real-browser behavior.

Hosted CI results

Hosted CI on d07f789a4: pending. All 29 checks passed on the previous head 5022efafe; no failures or reruns:

Check Result
browser integration tests Passed
cargo check (cloudflare native + wasm32-unknown-unknown) Passed
cargo check/build/test (spin native + wasm32-wasip1) Passed
cargo fmt Passed
cargo test Passed
cargo test (axum native) Passed
cargo test (cross-adapter parity) Passed
cargo test (ts CLI, native) (macos-latest) Passed
cargo test (ts CLI, native) (ubuntu-latest) Passed
CI Node pin guard Passed
CLAUDE.md symlink guard Passed
docs-proposal scripts Passed
Fastly response diff script Passed
format-docs Passed
format-typescript Passed
HTML EOF runtime (Fastly) Passed
integration tests Passed
integration tests (Fastly EC lifecycle) Passed
local-provider-image Passed
Native provider acceptance script Passed
prepare integration artifacts Passed
record-provider-image Passed
release scripts Passed
stock-celld-records Passed
trace runtime and browser acceptance Passed
ts dev lint domains (changed lines) Passed
vitest Passed
worker-deadlines (cloudflare) Passed
worker-deadlines (spin) Passed

Independent final source/evidence checks found zero blocking code findings and zero optional findings. Code review and CI are clear. Overall requested qualification remains blocked on the HTTPS producer transition described below; no review comments or replies were posted.

Draft and remaining qualification

This PR is currently not a draft. The outstanding requested HTTPS provider-response-to-persisted-memory runtime qualification remains unverified. Code review, all local checks and all hosted checks are clear. The earlier merge-conflict and configured-native-geo blockers are resolved. This still depends on open #1646 and its stack; that dependency must land first.

The requested full provider-response-to-memory runtime qualification remains unverified. The environment blockers below are historical: #1622 later reports a Linux production HTTPS-provider fixture using process-local trust. That is not a runtime receipt for this PR's provider-response-to-remembered-opt-out transition, and does not remove the qualification requirement. Native EdgeZero's production transport has no supported per-process fixture CA/routing override, and the current Fastly transport rejects predeclared backend-name collisions, preventing the old plaintext remap technique. No SDK guard or system trust setting was weakened. A supported local HTTPS fixture/trust/routing facility belongs in EdgeZero; no EdgeZero implementation was added here. See the pinned native transport and Fastly backend ownership handling. Broader provider/browser qualification remains tracked by #1581.

Checklist

  • Changes follow repository conventions; focused behavior has regressions.
  • No operator configuration, environment files or credentials changed.
  • No removed adapter-local implementation restored; no new runtime environment reads.
  • No comments or review-thread replies posted; only this PR's branch/base/description updated.

Runtime artifact receipts

Historical artifact receipts for the d72c8bb37 refresh and ee7a11031 pre-refresh control follow. Release artifacts were reported built with Rust 1.98.1 and Node 24.20.0, with debug symbols omitted; the original artifact bytes are not linked for independent hash verification. Both refreshed runtimes passed 28 bidder assertions plus the explicit seeded-memory receipt; the pre-refresh control passed 14 bidder assertions within its stated scope.

Artifact SHA-256
Refreshed Axum production executable, geo-cloudfront dc6abc25fcd17ae55b0bc7abef101aa2ac81045970174568b9a77ed86f617778
Refreshed Fastly production WASM 16fab5296b5994d62e8c96df0b1f887d22589ad4d4297b298e57a148f4597fe7
Pre-refresh ee7a11031 Fastly control 3d097e426db136cd6879ba6eabf7d2818e278586f7b5ce74edd525e6937dda4d

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
Pick up the container test correction (71a573a): operational probes
skip finalization, so the snapshot header is asserted on the page.
#1636 stays on #1646 and keeps #1646's shared after-response runner, as
5514190 adopts it. This merge brings #1646's chain head (b5a5f62), which
merges #1642's chain head (f654f67) and, through it, the identity chain
below: #1506's repin of EdgeZero to rc/identity at d063a8e7 and main's
Fastly SDK 0.13.3 upgrade (#1671), #1488's hashed-email intake and owned
request signals, #1489's mirrored UID expiry and request time, the identity
spine, the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and
#1627, with #1627's merge of #1625) and the held line from #1533 to #1642.

The merge had no textual conflicts. #1646's chain head gives its
AfterResponseLookups #1488's Referer and Accept-Language, which
prepare_after_response_lookups copies and run_after_response_lookups passes
to providers, so this PR's drain-test helper lookups_for, which copies the
request signals the shared runner hands to providers, copies those two
headers as well.

The chain's #1489 also passes finalize a FinalizeRequest, so the drain
tests' two ec_finalize_response calls pass one with the current request
time, which the navigation's page-load write needs before it issues the
follow-up permit the tests drive.
#1626 now stacks on #1636 instead of #1646. #1636 (72096cd) merges #1646's
chain head (b5a5f62) and drains Axum after-response identity tasks on
SIGTERM through #1646's shared runner, so this merge brings #1646 and the
chain below it through #1636, and the EC route line above this PR carries
#1636 as well. The merge applies #1636's change to this PR's merge of #1646
without conflicts.

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.

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.

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.

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, and #1646's aa31559, which gates identity writes for
rejected clients.

This PR's head moves to d07f789, through 909699d, its merge of #1646's
aa31559. d07f789 withholds a mirrored UID while another enabled owner
of its source has an active opt-out in the row.

EC mirror docs: d07f789 adds the owner opt-out condition to the
build_mirror doc, where #1489 added that every mirrored UID carries an exp
capped at 30 days from the UTC day start. The doc keeps both sentences.
aram356 added a commit that referenced this pull request Nov 25, 2026
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 added a commit that referenced this pull request Nov 25, 2026
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.

The merge also brings the 12 #1646 commits this PR lacked, from 48a43ae
to 461aa0d: dhruv8sh's page-phase lookup and /auction EID work
(48a43ae, 82fe088, 1d0a74f, 838586e and his chain merges a061c01,
ecf16e8, e1d23a0, edcf4c5 and 9a020e1), the merge 9cad928 of
#1641 into #1642, and prk-Jr's "Merge providers-awaited into shared
identity" (4ffbaf8) and "Restore Fastly auction browser gating"
(461aa0d).

Edge cookies guide: a conflict is the request lifecycle paragraph.
The merge takes #1646's sentences on positive identity cookies, core
expiries and /auction body EIDs, and keeps this PR's closing sentences on
the default ec.sliding_refresh = false flow and sliding renewal.

Fastly adapter tests: 82fe088 from #1646 removed the navigation-lookups
thread-local and the page-lookups argument of apply_edgezero_ec_finalize,
since the handler now collects page lookups onto the EC context. This PR's
sliding_ec_renews_held_publisher_identity_before_terminal_privacy test
drops its two take_navigation_lookups calls and passes no page lookups to
finalize. Its configuration has no record store or providers, so no
lookups were collected before either, and its assertions are unchanged.

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.

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

Cloudflare route tests: both PRs add a test at the end of the file. The
merge keeps both, this PR's
sliding_ec_configuration_preserves_unsupported_platform_responses and
#1661's ec_route_creates_no_record_whatever_the_bot_management_ja4.

Fastly sliding EC test: #1617, which now sits below this PR, answers GET
/health through the router's probe hook as an operational response, which
carries no EC state. This PR's
sliding_ec_renews_held_publisher_identity_before_terminal_privacy routes
/health through the router and expected EC state on every path but the
unsupported EC route, so it now also accepts the liveness probe without EC
state. Its check that /health issues no renewal cookie is unchanged.

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.

Settings: this PR's MaxAgeDays and #1488's HashedEmailSource are both
added before Ec in settings.rs; the merge keeps both.

This PR's head moves to fbe5670, its merge of #1646's aa31559, which
models admitted clients in the core sliding tests, finalizes them with
the store gate and adds refused_client_gets_no_renewal_or_record_io, and
adds the proposal's review log. Taken as the change from the old head
668d501, the new head would replay #1646 commits the base already
carries in rebuilt form. The merge takes only fbe5670's own resolution,
the change from a plain merge of 668d501 and aa31559 to fbe5670:
the sliding tests and the proposal apply cleanly, and its Fastly sliding
test port is the one this merge already made.
aram356 added a commit that referenced this pull request Nov 25, 2026
…1622 into rc/identity

#1622 (244ca26) now carries the whole chain, each PR merging the one below
it:

- #1506 (c197404) repins EdgeZero to rc/identity at d063a8e7, which
  carries EdgeZero main's Fastly SDK 0.13.3 upgrade through every EdgeZero PR
  here, and merges Trusted Server main's upgrade (#1671): fastly 0.13.3, url
  2.5.9 and Viceroy 0.22.0.
- #1614, #1525, #1526, #1487 and #1488 take it in turn. #1488 also adds
  b2d4bfd, which records known UID hashes with a setter.
- #1489, the identity spine (#1639, #1640, #1612, #1628 and #1623), #1531 and
  #1532.
- The Axum serving line: #1613, #1616, #1617, #1615, #1635, #1637 and #1627,
  chained, with #1627's b958107 decoding the Spin discovery document with
  Response::json and #1627's merge of #1625, which brings #1625's Wrangler pin
  into the chain.
- The held line on #1627: #1533, #1534, #1536, #1535, #1537, #1539, #1538,
  #1540, #1566, #1624, #1641, #1642 and #1646. #1646 keeps its own shared
  after-response runner in ec::app::lookups.
- #1636 (72096cd) on #1646 (b5a5f62), draining Axum
  after-response identity tasks on SIGTERM through #1646's shared runner.
- The EC route line on #1636: #1626 (067531e), which merges #1636, the
  draft #1656, #1661, #1662 and #1622, and through #1622's merge of it,
  #1620's round-6 head.

Each conflict was resolved in the PR that sits higher. This merge is clean.

Since the last update the chain also takes #1488's hashed-email intake
(a610152 and 9104fd3) and its POST, body and header options for the
status call (f063a76), #1627's split of the generic runtime KV store into
trusted_server_runtime_kv (4d0c1a2), #1646's gate on identity writes for
rejected clients (aa31559) its native container test of the failure router
(4f4c036) and that test's header check on an ordinary route (71a573a),
#1626's withholding of a mirrored UID while another source owner is opted
out (d07f789), and #1617's description of the Axum startup failure router
(6d174a8) and of the startup failures that still exit before listening
(4c07cad). #1636 no longer sits in the Axum serving line; it arrives
through #1626, which merges it on top of #1646. Its new head adopts #1646's
after-response runner in place of the one rc/identity took with cf1102c.

Cloudflare guide: #1627's merge of #1625 now keeps both #1625's tool version
clause and #1627's TRUSTED_SERVER_RUNTIME_KV binding in the smoke paragraph,
and fixes #1625's smoke script test for #1617's Python floor and Worker
build, and #1537's merge fixes its ts stub for #1537's storage template
step, so this merge needs no resolution.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 067531e98, a merge of #1636's new head 72096cd1f onto this PR's d07f789a4. This PR now stacks on #1636 instead of #1646. #1636 merges #1646's new head b5a5f62f8 and drains Axum after-response identity tasks on SIGTERM through #1646's shared runner, so this merge brings #1646 and the chain below it through #1636, with #1506's repin of EdgeZero to rc/identity at d063a8e7 and main's Fastly SDK upgrade (#1671), and the EC route line above this PR carries #1636 as well.

The one conflict was the build_mirror doc in ec/mirror.rs: this PR's d07f789a4 adds the owner opt-out condition where #1489 added that every mirrored UID carries an exp capped at 30 days from the UTC day start. The doc keeps both sentences.

The base should now be feat/1575-drain-after-response (#1636). GitHub does not allow a base change for a PR inside a stack (stack 1665), so it is still feat/1574-axum-shared-identity, and until it moves the diff also shows #1636's changes.

#1646's new head 9f648f6 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.
#1636's new head 1fb5bc3 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

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 97413ae4a, a merge of #1636's new head 1fb5bc3b5. 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 #1646's new head 9333826, 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.
Takes #1636's new head 3c6b34c, 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

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 7c817db9a, a merge of #1636's new head 3c6b34c54, 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 base change to feat/1575-drain-after-response (#1636) is still blocked, because GitHub does not allow a base change for a PR inside a stack (stack 1665).

#1646's new head 4f1c155 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.
#1636's new head ee3a9af 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

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 681616009, a merge of #1636's new head ee3a9afc8, 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 only change to this PR's tree is that store 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 makes three changes:

  • Opt-outs: remembered provider opt-outs are now enforced on stored EIDs on every read path: live_eids, identify, mirror and the admin preview. They also apply to client EIDs from the ts-eids cookie and the /auction body. The ownership check covers both SharedID aliases.
  • Legacy expiry: a legacy single-UID record now expires as soon as an enabled provider owns its source.
  • After-response tasks: schedule_after_response now returns a #[must_use] bool. It only registers work when finalize issued a follow-up permit.

Supporting changes:

  • The registry keeps a list of enabled owner provider IDs for each source.
  • The client-EID filter only applies an opt-out when the KV snapshot belongs to the same EC ID.
  • Fastly's unused settings parameter is removed.

I found no issues I could verify. The diff has no binary or hidden files and no text aimed at manipulating a reviewer.

Non-blocking

👍 praise

  • Consistent, fail-open opt-out filtering: see the cross-cutting section below.
  • Thorough test coverage: see the cross-cutting section below.

Cross-cutting / body-level findings

  • 👍 Consistent, fail-open opt-out filtering: the filtering works the same way on every read path. When the snapshot is missing, failed or belongs to another EC ID, it fails open and keeps the client EIDs, which is the documented behaviour. The opt-out boundary uses the existing KvEntry::opted_out semantics.
  • 👍 Thorough test coverage: every path has tests:
    • unit tests for the alias and normalised-source cases
    • a 2×2×2 auction matrix over repeated visits
    • the publisher and page-bids targeting paths
    • real-process tests for the SIGTERM drain and the Axum opt-out flow

CI Status

  • integration tests (Fastly EC lifecycle): PASS
  • integration tests: PASS
  • docs-proposal scripts: PASS
  • Native provider acceptance script: PASS
  • CI Node pin guard: PASS
  • cargo fmt: PASS
  • vitest: PASS
  • cargo check/build/test (spin native + wasm32-wasip1): PASS
  • CLAUDE.md symlink guard: PASS
  • format-docs: PASS
  • format-typescript: PASS
  • health-startup (spin): PASS
  • cargo test (axum native): PASS
  • HTML EOF runtime (Fastly): PASS
  • release scripts: PASS
  • health-startup (cloudflare): PASS
  • health-startup (fastly): PASS
  • browser integration tests: PASS
  • trace runtime and browser acceptance: PASS
  • cargo test: PASS
  • local-provider-image: PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • Fastly response diff script: PASS
  • health-startup (axum): PASS
  • ts dev lint domains (changed lines): PASS
  • cargo test (cross-adapter parity): PASS
  • record-provider-image: PASS
  • worker-deadlines (spin): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • stock-celld-records: PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • prepare integration artifacts: PASS
  • worker-deadlines (cloudflare): PASS

Takes #1646's new head 6b4a5fd, 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.
Takes #1636's new head 73a36a9, 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

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

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

Takes #1636's new head 73a36a9, 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.

Reviewed #1626's own changes at 8ea87b7ce against the live #1646 base at 6b4a5fdc0, excluding the inherited #1636 drain work. Approving with eight inline comments. I recommend addressing R1–R3 before merge.

Formatting and diff checks passed, and hosted Fastly and Axum checks used a tree identical to this head. The core bidder capture covers seeded remembered state. The native executable test covers a request carrying the opt-out cookie, not remembered-state enforcement without it. HTTPS provider-response-to-persisted-memory qualification remains open.

&& !partner.excluded_for(consent)
&& !registry.source_owner_opted_out(source, self, now)
&& (!registry.source_has_enabled_provider_owner(source)
|| record.is_provider_written())

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 · P2: An expired SharedID blocks the valid cookie that could replace it. For a returning visitor with a legacy single and a valid provider cookie, this hides the single, but ec/coordinator/mod.rs:1014–1022 still treats it as live and drops the cookie. With generate = false, no replacement is written, so the stored EID stays unavailable as long as the single remains. Use the coordinator's existing holds_live_uid predicate in that branch, and cover a legacy row with generation disabled. Live provider-written UIDs should keep their precedence.

&& !partner.owner_vendor_consent_denied(consent)
&& !partner.excluded_for(consent)
&& !registry.source_owner_opted_out(source, self, now)
&& (!registry.source_has_enabled_provider_owner(source)

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 · P2: SharedID write-back can reissue the expired UID. With managed SharedID cookie storage and no incoming SharedID cookie, ec/sharedid.rs:461–465,487–501 can still read the legacy single through raw source_views and restore it as a browser cookie. Prebid can then send it back as a client EID. Fixing R1 alone does not cover this case. Share the stored-record eligibility rule with write-back, identify, and admin preview. Preserve unowned SharedID write-back and live provider IDs; no extra KV read or row deletion is needed.

&& partner.mirror_enabled
&& !partner.owner_vendor_consent_denied(consent)
&& !partner.excluded_for(consent)
&& !partners.source_owner_opted_out(&partner.source_domain, row, now)

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 · P2: An auction can know about an opt-out and leave the old mirror intact. If an after-response lookup records an opt-out after the mirror was issued, a later non-document auction can read the matching row and withhold the EID from bidders. But ec/finalize.rs:130–148,195–213 checks remembered state only through the navigation rebuild, leaving the carried JavaScript-readable mirror intact. Use the row already read by the auction to expire a carried mirror containing a withheld source. Keep existing behavior when the row is unknown. No extra read or positive cookie is needed; unrelated mirror entries can wait for the next eligible rebuild.

{
partner
.owner_provider_ids
.push(ProviderId::new(&provider.id));

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: Represent enabled ownership once per exact source. This repeats the source normalization and lookup in mark_provider_owned and stores the owner fact as both a boolean and a list. The new registry and mirror fixtures allow two enabled owners of one exact source, but ec/provider.rs:951–962 rejects that configuration. Store one owner ID per exact source and derive the boolean. Keep vendor gates separate because disabled providers can still gate consent. Test overlap using distinct owners of the two SharedID aliases.

}

#[test]
fn navigation_and_page_bids_drop_opted_out_cookie_eids() {

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: Name this regression for the helper it exercises. Both iterations call apply_auction_eids_and_device with the same targeting inputs; the only change is a log label. The test would still pass if either route stopped passing its snapshot to the helper. Run the helper once and name the test and assertion for shared targeting. Verify the two route entry points separately with bidder captures if claiming route-level coverage.

pub(crate) fn drop_vendor_denied_client_eids(
client_eids: Option<Vec<Eid>>,
registry: Option<&PartnerRegistry>,
snapshot: &EcKvSnapshot,

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: Name and document the matching-row gate. The current name and doc comment describe vendor consent, request-cookie opt-outs, and GDPR exclusion, but a matching row now independently withholds an EID. Rename this helper for provider policy, for example filter_client_eids_by_provider_policy, and document that missing or mismatched snapshots don't establish an opt-out.

Comment on lines +1343 to +1357
let ec = issued
.headers()
.get_all("set-cookie")
.iter()
.filter_map(|value| value.to_str().ok())
.find_map(|value| {
value.strip_prefix("ts-ec=").map(|value| {
value
.split(';')
.next()
.expect("should contain EC")
.to_owned()
})
})
.expect("should issue EC using prepared persistent records and protected country");

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: Reuse the existing EC response-cookie parser. ec_response_cookie at line 54 does the same Set-Cookie parsing. Broaden its feature gate to #[cfg(feature = "geo-cloudfront")], then use it here:

Suggested change
let ec = issued
.headers()
.get_all("set-cookie")
.iter()
.filter_map(|value| value.to_str().ok())
.find_map(|value| {
value.strip_prefix("ts-ec=").map(|value| {
value
.split(';')
.next()
.expect("should contain EC")
.to_owned()
})
})
.expect("should issue EC using prepared persistent records and protected country");
let ec = ec_response_cookie(&issued)
.expect("should issue EC using prepared persistent records and protected country");

#1566. The #1646 refresh replaces its adapter-specific lifecycle with the
shared application and retains remembered opt-out and legacy-record policy.

## Native runtime qualification

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.

R8: End the spec with its review log. CONTRIBUTING.md:99 asks for ## Review log to be the last section. Move Native runtime qualification above it, leaving both sections intact.

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