Repository navigation
Conversation
The merge applied without conflicts. The Prebid integration config keeps this pull request's mode field next to the base's changes, and the example config, the Prebid guide and the tsjs Prebid sources take both sides unchanged. The server mirror cookie the identity mode reads is the same name and envelope in the base, so no code needed to change.
|
For the identity integration chain (#1608), this PR's base #1489 was ported onto #1506's EdgeZero cutover and #1526's async store, so Checked locally at |
|
For the identity integration chain (#1608), |
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. Prebid shim: syncPrebidEidsCookie keeps this PR's single payload check with change-only writes and stale-capture clearing, since both sides already removed the getUserIdsAsEids guard. collectAuctionEids now reads ortb2.user.ext.eids from the global Prebid config in both modes. Identity mode still writes mirrored IDs only into the request-local ortb2, so they never reach the global config or the ts-eids capture. Artifact test: the merged shim measures 55,336 characters, so the size guard keeps this PR's 55.5 KB limit, and its comment now names the ortb2.user.ext.eids forwarding. 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.
|
For the identity integration branch (#1608), I pushed |
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
This PR adds a PrebidMode setting on the Rust side. It defaults to auction and can be set to identity, and the value is passed into the injected browser config. In identity mode the JS shim:
- leaves bidders, ad units and GPT refresh alone;
- merges the
__Host-ts-eids-mirrorEIDs into each request's ownortb2, skipping IDs that are already present, without changing the publisher's objects; - polls native IDs every second (and on visibility changes and BFCache restores), rewriting the
ts-eidscookie only when the value has changed.
Auction-mode setup now runs after the identity early return and behaves the same as before. One gap remains: the module installs the GPT refresh handler based only on the server-injected mode. That breaks the promise that identity mode leaves GPT untouched when a publisher picks the mode through the JS config.
Cross-cutting / body-level findings
-
🔧 GPT refresh handler ignores the JS-configured
mode—crates/trusted-server-js/lib/src/integrations/prebid/index.ts:482(this line isn't in a diff hunk, so the finding lives here). The check reads only the server-injectedwindow.__tsjs_prebid.mode. ButPrebidNpmConfig.modeis public and can override the injected value (config?.mode ?? injected?.mode). Two cases break:- A publisher who sets identity mode only through
installPrebidNpm({ mode: 'identity' })still has GPTrefreshtaken over by the auction refresh handler. That goes against the promise that identity mode leaves GPT untouched. - If the server injects
identityand the JS call passesmode: 'auction', no refresh handler is installed at all.
Proposed fix: install (or tear down) the refresh handler based on
merged.modeinsideinstallPrebidNpm. Alternatively, document thatmodecan only be set from the server and drop it fromPrebidNpmConfig. Either way, add a test for the JS-config path. - A publisher who sets identity mode only through
-
👍 Defensive mirror parsing — EID mirror parsing is defensive. It requires unpadded URL-safe base64, which matches the server's
URL_SAFE_NO_PADencoding. -
👍 Thorough tests — the new identity-mode behaviour has thorough test coverage.
CI Status
- integration tests: PASS
- integration tests (Fastly EC lifecycle): PASS
- vitest: PASS
- format-typescript: PASS
- format-docs: PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- Fastly response diff script: PASS
- worker-deadlines (spin): PASS
- cargo test (axum native): PASS
- cargo test (cross-adapter parity): PASS
- cargo test: PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- browser integration tests: PASS
- trace runtime and browser acceptance: PASS
- CI Node pin guard: PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- cargo fmt: PASS
- worker-deadlines (cloudflare): PASS
- HTML EOF runtime (Fastly): PASS
- release scripts: PASS
- docs-proposal scripts: PASS
- ts dev lint domains (changed lines): PASS
- CLAUDE.md symlink guard: PASS
- prepare integration artifacts: PASS
- cargo test (ts CLI, native) (macos-latest): PASS
The shim chose identity or auction hooks from the merged JS and injected config, but decided whether to wrap GPT refresh from the injected value alone, so a JS `mode` could leave the two disagreeing. The shipped shim self-installs without arguments, so the JS field had no real caller. Drop `mode` from PrebidNpmConfig and read it only from the injected config, and add tests with a stable pubads object that observe whether the refresh handler is installed.
|
Addressing dhruv8sh's review: the GPT refresh handler didn't follow the JS-configured Fixed in c3b0c84, following your second option:
Checked locally on Node 24.12.0 (the repo pins 24.20.0): vitest 3352 passed with 1 skipped, plus JS format, eslint, |
dhruv8sh
left a comment
There was a problem hiding this comment.
I'm approving this PR. It adds a server-owned mode setting (auction by default, or identity) to the Prebid integration. Identity mode does four things:
- It wraps
requestBidsto merge the__Host-ts-eids-mirrorcookie into the request-localortb2.user.ext.eids, without mutating the publisher's objects. - It skips the bidder, ad-unit and GPT-refresh hooks.
- It samples native IDs into
ts-eidsevery second, pausing and resuming around back/forward-cache navigation. - It only rewrites the cookie when the value changes.
I found no blocking issues.
- Validation and dedup: the mirror parser checks the length cap, the charset, strict UTF-8,
v,atypeandexpbefore using anything. Deduplication covers both the global and the request EID locations. - Mode can't be overridden from JS: only the server-injected config sets the mode, and the refresh-handler decision reads the same value.
- Auction mode unchanged:
syncPrebidEidsCookie()with no argument behaves as before. - Tests: the new tests cover lifecycle, blocked cookies, malformed mirrors and expiry.
One non-blocking item: the 1-second setInterval runs for the whole life of every identity-mode page, and each tick calls getUserIdsAsEids and reads document.cookie, including while the tab is hidden. Pausing it while document.visibilityState === 'hidden', or backing off once IDs are stable, would cut the background cost. It doesn't affect correctness. The shim size guard going from 53 KB to 55.5 KB is justified.
|
For the identity integration branch (#1608), I pushed Takes #1489's new head e6c0e51, 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. This merge sits on your new commit |
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed #1620 against the live feat/s2s-eid-collection-providers base at e6c0e51af. I’m requesting changes for the native-only capture contract and the publisher request compatibility issue. The inline comments distinguish blockers from follow-ups.
The shipped shim was exercised in memory with a generated Prebid 10.26 bundle in JSDOM, using synthetic IDs and a controlled bidder. I did not rerun real Chrome or deployed adapter checks.
Capture only native IDs in identity mode, preserve publisher User Sync policy, and read mirrors after Prebid admits requests while retaining its hook API. Retry replaced consent APIs without repeatedly subscribing to unchanged CMPs. Pause hidden-document polling and document fail-closed startup clearing. Cover these paths with native capture and generated Prebid regressions.
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Re-review of 78c2aed5a..7f4e59565 (one commit).
All seven items from my last review are addressed, along with dhruv8sh's hidden-tab polling note. R4 (the first empty sample clearing a valid carried cookie) is handled as a documented fail-closed choice; I'd still argue the other way, but I'm fine with it as written.
Approving. One naming nit inline, please take care of it before merging.
PR #1489'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.
|
Round 12 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
PR #1489'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. 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.
|
Round 15 identity realignment:
#1622 now merges this branch's new head, including Each merge message says what it carries and how any conflict was resolved. |
|
Fixed mirror/native EID overlap in 4938660f3. Native User ID enrichment appends IDs after the mirror merge, so identity mode now removes exact repeated UID data at client bidder delivery and in the final PBS HTTP body before optional gzip. Different IDs, Verification: JS build, lint and format pass, with 3,387 tests passing. Generated Prebid 10.26 and isolated 10.28 caller probes cover cold/warm initialization, normal/gzip PBS delivery and consent redaction. An early getter-only filter still fails the cold case; a client-only fix still fails both PBS wire cases. All required local gate groups passed, including the committed PR domain scan. Supplemental browser verification attached the candidate listeners to the existing Prebid 10.28 runtime and removed identical duplicates from actual outgoing requests. This was temporary local instrumentation; the AWS deployment still uses its previous build. Hosted CI is pending for this commit; no merge-readiness claim is made. |
|
Round 17 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1489's new head ( Checks on this head: no conflict markers; |
Summary
integrations.prebid.mode = "identity"so publishers can use managed Prebid identity without installing Trusted Server's browser auction integration. Existing configurations default to"auction".ts-eids, including pages that never run an auction.Revision status, checked 2026-12-03 12:12 UTC: the maintainer advanced this PR to
98a56e8550, with basefeat/s2s-eid-collection-providersat2239b604b48a39345968f5484340db3019089476and EdgeZeroef5cbf308. Earlier signed review correction827f0e38b5remains 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 21 contexts (21 QUEUED); full current-head qualification is assessed separately.Stacked on #1489, targeting
feat/s2s-eid-collection-providers; the mirror writer must land first.Enable identity-only mode
Update the existing table in your application configuration and publish the updated config:
Keep the existing external bundle, module selection and managed User ID settings. Add or update
modein the existing table; do not create a duplicate TOML table. Deploying the code alone does not enable this mode. Omittedmodedefaults to"auction".See the identity-only setup guide.
Changes
crates/trusted-server-core/src/integrations/prebid.rscrates/trusted-server-js/lib/src/integrations/prebid/index.tscrates/trusted-server-js/lib/src/integrations/prebid/native_capture.tscrates/trusted-server-js/lib/src/integrations/prebid/identity.tscrates/trusted-server-js/lib/test/integrations/prebid/identity.test.tscrates/trusted-server-js/lib/test/integrations/prebid/index.test.tscrates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjsdocs/guide/integrations/prebid.mdtrusted-server.example.tomldocs/superpowers/specs/2026-11-17-identity-only-tsjs-design.mddocs/superpowers/plans/2026-11-17-identity-only-tsjs.mdCloses
Closes #1594
Spec
Spec: Identity-only tsjs mode, including two agent review rounds.
Historical correction verification
The correction in 827f0e3 names the capture-mode flag
identityCapture: it governs native source selection, changed-only cookie writes, stale clearing and warning deduplication.collectAuctionEids(nativeOnly)keeps its narrower source-selection name. Defaults, call sites and behavior are unchanged; all 13 built JavaScript bundles, including Prebid, are byte-identical before and after the rename.Fresh local checks on this revision:
All 25 hosted checks passed on review-correction commit
827f0e38b5eb3cb4a36022e817f2220a618f78f2; those results do not qualify the later SDK merge. Historical browser/deployed observations below were not repeated for this naming-only correction. Their underlying receipts were unavailable to this audit; they do not establish fresh deployed-service or live-vendor qualification.Historical runtime observations
Browser verification exercised the actual Fastly and Axum applications, trusted HTTPS development proxy, real Chrome and a controlled bidder. Seven reader scenarios per adapter cover native capture before any auction, mirror delivery/removal/replacement/expiry/malformed input, metadata precedence, consent denial/restoration and no mirror echo. The controlled reader fixture supplied a generated Prebid 10.26 bundle and synthetic mirror; the application injected and served the changed tsjs normally.
A separate operator-config run used the configured publisher origin and external Prebid bundle, without manual
requestBidscalls. Automatic native capture was observed on the Fastly homepage and an Axum article; captured IDs matched the native getter and unchanged samples did not rewrite the cookie. Some repeated publisher runs encountered external bundle/origin timeouts or absent third-party identity setup, so these observations do not qualify third-party reliability.Subsequent deployed Fastly staging verification passed six controlled cookie-provider scenarios: provider input, replacement, opt-out, restoration, and persisted-ID reuse after removing the provider input, carried mirror and native capture cookies. The server reissued the mirror and the actual deployed Prebid bidder consumer received the expected ID without mirror echo. The controlled bidder returned no HTTP requests; these checks do not qualify live vendor APIs, bidder HTTP delivery or other provider kinds. The served shim matched the reviewed build; the backend version header identified the branch rather than an exact commit. Local Viceroy still lacks the JA4 metadata required for normal provider activation, and Axum does not support enabled providers.
Checklist
unwrap()added in production codelogmacros (notprintln!)