Skip to content

Honor Prebid's user ID opt-out cookie - #1737

Draft
prk-Jr wants to merge 3 commits into
fix/1555-provider-eid-opt-outsfrom
fix/1703-pbjs-id-optout
Draft

prk-Jr wants to merge 3 commits into
fix/1555-provider-eid-opt-outsfrom
fix/1703-pbjs-id-optout

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Honor _pbjs_id_optout with any value, including empty. Previously a consented reader carrying this cookie could receive SharedID cookies and a mirror, and their IDs could reach bidders. Now SharedID and its consent companion are expired, the mirror is suppressed or expired, every auction EID is withheld, and every configured identity provider treats the marker as its own opt-out: no provider lookup is made and its stored UIDs are cleared.
  • Use shared cookie-name constants across core and the SharedID provider. Preserve _pubcid_optout's existing SharedID-specific scope for unrelated partner IDs.
  • Cover document navigation, EC GET/POST, stored and client-supplied auction IDs, split Cookie fields, missing registries and no-opt-out controls.

Stacked on #1626. Base: fix/1555-provider-eid-opt-outs at 1ad8ba4c74f7337e1d788c65d4988c4d1371953a.

Overlap with #1672: both changes use request-cookie source policy. This PR adds a global opt-out and reusable cookie-presence handling; it does not change alias-aware matching between pubcid.org and sharedid.org or close #1672.

Changes

Files Change
Core ec/coordinator/mod.rs Report the marker as every provider's cookie opt-out, so page and after-response dispatch skip lookups and clear provider sources.
Core ec/sharedid.rs, ec/provider.rs, ec/mod.rs Centralize names, recognize empty markers and retain global opt-out on the request context.
Core auction/endpoints.rs, publisher.rs Withhold stored, cookie and body EIDs, including unregistered client sources; skip opted-out browser/body ingestion.
Core ec/finalize.rs, ec/mirror.rs, ec/app/route.rs Prevent mirror creation and expire carried cookies, including EC GET without EC identity or creation permission.
Core ec/admin.rs Update diagnostic SharedID opt-out documentation.
Core shared conformance, Axum/Fastly conformance and Axum native acceptance Add regression and positive-control coverage through shared policy and the actual Axum executable.
SharedID identity provider Use the shared marker list and presence-aware cookie checks.
API, configuration, edge-cookie guides and existing identity plan/spec Document the additional marker, its all-partner scope and its all-provider opt-out.

Opt-out site audit

Existing _pubcid_optout reader or consumer How _pbjs_id_optout applies
Core sharedid_opted_out / SharedIdRequest::from_request Both markers suppress SharedID reading, ingestion, generation and writeback.
SharedIdProvider::read_request_cookies Both markers report CookieRead::OptedOut, including empty values.
Admin cookie-ingestion preview Both suppress SharedID in the diagnostic preview.
handle_auction The global marker removes every stored, cookie-supplied and body-supplied EID from bidder output.
persist_auction_body The global marker skips all body EID ingestion.
ProviderCoordinator cookie reads and dispatch The global marker reports CookieRead::OptedOut for every provider before its own cookies are read.
handle_publisher_request Request-context policy suppresses all stored and cookie EIDs in initial-page targeting.
handle_page_bids The same policy suppresses all stored and cookie EIDs in deferred page-bids targeting.

The global request policy also reaches identify, mirror rebuilds and fallback cleanup. EC POST returns an empty mirror; EC GET performs expiry-only cleanup before EC-presence and creation guards. Provider-source alias matching remains unchanged.

Closes

Closes #1703.

Spec

Not a feature; bug fix without a configuration or persisted-schema change.

Test plan

Local checks ran on the committed source. The full CI gates are left to GitHub Actions as requested.

  • Native core library: 3922 passed, 2 ignored. New coordinator test covers providers with and without vendor cookies and 1/empty marker values; removing the marker check fails it.
  • cargo test --locked -p trusted-server-core --lib auction::endpoints::: 63 passed.
  • cargo test --locked -p trusted-server-core --lib publisher_targeting: 2 passed.
  • cargo test --locked -p trusted-server-identity-providers --lib: 135 passed.
  • cargo test-axum --locked --lib identity_conformance: 7 passed.
  • cargo test-fastly --locked identity_conformance: 3 adapter tests and 1 portable core test passed under pinned Viceroy 0.22.0.
  • cargo test --locked -p trusted-server-adapter-axum --features geo-cloudfront --test native_acceptance prepared_prebid_optout_withholds_all_partner_identity -- --exact: passed through the actual Axum binary.
  • cargo clippy-fastly, cargo clippy-axum, cargo clippy-cloudflare and cargo clippy-spin-native.
  • cargo fmt --all -- --check, changed-doc Prettier checks and git diff --check.

Fail-first evidence: the original source ignored the marker in both SharedID readers and delivered stored/body/client EIDs to the bidder. The native navigation regression failed because no SharedID expiry was emitted. An additional EC GET regression reproduced the retained mirror before its correction.

An extra native cargo clippy --locked -p trusted-server-core -p trusted-server-identity-providers --all-targets --all-features -- -D warnings fails on unchanged test_support.rs:203 (result_large_err, error variant at least 192 bytes). The identical command fails on an untouched archive of the exact #1626 base. No suppression or unrelated fix is included. The target-matched blocking lint gates pass.

Self-review

READY TO REQUEST REVIEW. The EC GET mirror-cleanup finding was reproduced and corrected. A misleading TCF-gating diagnostic was also corrected. A later pass found that configured identity providers other than SharedID still looked up and stored vendor IDs for an opted-out reader; the coordinator now treats the marker as every provider's opt-out.

Runtime verification

VERIFIED on the first commit for the supported #1626 flows through the actual local Axum executable, production configuration envelope and local persistent records, with authenticated synthetic forwarding, DE geography and TCF Purposes 1 and 4 granted. No vendor consent gates were configured. No browser, deployed service or live provider was used.

With _pbjs_id_optout=1, navigation and EC POST emitted:

Set-Cookie: _pubcid=; Domain=.publisher.example.com; Path=/; Secure; SameSite=Lax; Max-Age=0
Set-Cookie: _pubcid_cst=; Domain=.publisher.example.com; Path=/; Secure; SameSite=Lax; Max-Age=0
Set-Cookie: __Host-ts-eids-mirror=; Path=/; Secure; SameSite=Lax; Max-Age=0

EC POST returned {"eids":[],"v":1}. Actual bidder requests still occurred, but their user object contained only consent, ext and id; user.eids was absent for both body and cookie EID inputs. The same results passed for yes, 0 and an empty marker. Fresh opted-out readers received no positive SharedID, companion or mirror cookie. EC GET expired carried cookies with and without an EC; shared adapter tests also cover refused clients.

Without the marker, the control issued SharedID, companion and mirror cookies with Max-Age=31536000, returned a populated EC mirror, and delivered pubcid.org, other.example.com and unregistered.example.com EIDs to the actual bidder. An unchanged EC GET left cookies alone.

Base limitation: #1626 does not yet emit a top-level sharedId response field, even in the control. Its absence under opt-out is observed, but positive qualification of that field remains on the higher EC-route stack; this PR does not add that feature.

Checklist

  • Changes follow AGENTS.md conventions.
  • New behavior has tests, including error and preservation cases.
  • No new production unwrap(), logging backend, dependency or configuration key.
  • Tests use fictional hosts and synthetic IDs; no credentials or operator configuration changes are included.

@prk-Jr prk-Jr self-assigned this Dec 4, 2026
@prk-Jr prk-Jr linked an issue Dec 4, 2026 that may be closed by this pull request
1 task
prk-Jr and others added 2 commits December 4, 2026 20:22
Prebid's _pbjs_id_optout disables every user ID module, but only the
SharedID provider honored it. Other configured providers still read
their vendor cookies, made lookups with the reader's signals and stored
the resulting UIDs, which were withheld from auctions but kept.

Report the marker as each provider's own cookie opt-out in the
coordinator, so page and after-response dispatch skip every lookup and
clear the provider's sources, and request egress withholds them. Update
the configuration and edge cookie guides and rewrap two module docs.
@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as 17a39121e, on top of 2061e196d.

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 #1626's new head (9d8d4aced), 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.

Honor Prebid's _pbjs_id_optout cookie

2 participants