Skip to content

Send EIDs in OpenRTB 2.6 user.eids - #1612

Open
dhruv8sh wants to merge 4 commits into
feat/s2s-eid-collection-providersfrom
feat/openrtb-user-eids
Open

dhruv8sh wants to merge 4 commits into
feat/s2s-eid-collection-providersfrom
feat/openrtb-user-eids

Conversation

@dhruv8sh

Copy link
Copy Markdown
Collaborator

Stacked on #1489. This PR targets feat/s2s-eid-collection-providers and must merge after #1489.

Summary

  • SID-4 of the server-side identity design puts EIDs in the OpenRTB 2.6 user.eids field. Until now every builder wrote only the pre-2.6 user.ext.eids. The bidder driver (standard, prebid-server and aps profiles), the Prebid Server integration and the APS integration now write user.eids.
  • UserExt.eids is removed, so the standard and prebid-server paths can no longer write user.ext.eids; the compiler enforces it. APS is the one downstream that keeps user.ext.eids, alongside user.eids, because the Prebid.js APS adapter these requests mirror has only ever sent EIDs there (evidence below).
  • This is a wire change for operator-configured bidders, so it has a Breaking CHANGELOG entry: an endpoint that reads EIDs only from user.ext.eids stops receiving them.

Changes

File Change
crates/trusted-server-core/src/openrtb.rs Remove UserExt.eids. Add OpenRtbEid alias, From<&Eid>/From<&Uid> conversions to the generated 2.6 types, to_openrtb_user_eids, and the APS-only ApsUserExt { consent, eids }. Conversion tests.
crates/trusted-server-core/src/auction/openrtb.rs Bidder driver fills user.eids; the APS profile also mirrors them through ApsUserExt.
crates/trusted-server-core/src/integrations/prebid.rs Prebid Server request fills user.eids. EID tests check both fields.
crates/trusted-server-core/src/integrations/aps.rs APS request fills user.eids and mirrors user.ext.eids. New no-EID test; wire fixture updated.
crates/trusted-server-core/src/auction/test_support.rs assert_no_user_eids, user_eids and aps_user_eids wire helpers.
crates/trusted-server-core/src/auction/openrtb/tests.rs Per-profile placement and absence tests; exact wire fixtures updated.
crates/trusted-server-core/src/settings.rs Doc comment names user.eids.
CHANGELOG.md Breaking entry under [Unreleased] → Changed.
docs/guide/** ec-setup-guide, edge-cookies, integrations/cookie-forwarding, integrations/prebid and integrations/aps name the new field.

Behaviour notes

  • An empty EID list is now omitted rather than serialized as "eids":[].
  • An EID or UID ext that is not a JSON object is dropped, because OpenRTB requires ext to be an object. Client ingress already drops non-object UID ext, so this only affects malformed stored or provider data.

APS: why it keeps user.ext.eids

The APS request copies the Prebid.js APS adapter (ext.sdk = {"source":"prebid","version":"2.2.0"}, endpoint /e/pb/bid):

  • modules/apsBidAdapter.js has ADAPTER_VERSION = '2.2.0' and builds its body with ortbConverter. It never touches eids or ortb2.user itself and does not use the 2.6→2.5 translator.
  • modules/userId/index.ts writes EIDs into ortb2 at user.ext.eids. Nothing in it writes user.eids.

So APS has only ever received EIDs in user.ext.eids from Prebid.js. That shows what APS is sent, not that it ignores user.eids, so APS gets both fields. Open item: confirm with the APS account team, or from a captured request, which field the /e/pb/bid endpoint reads, then drop the mirror if user.eids is enough.

How the "check both fields" criterion is met

A few EID-absence tests assert on the internal AuctionRequest.user.eids rather than on serialized OpenRTB:

  • auction/endpoints.rs: EidCapturingProvider, used by auction_strips_client_eids_when_ec_identity_denied
  • auction/formats.rs: auction_request.user.eids.is_none()
  • publisher.rs: the withdrawn-reader auction

That is the only EID field on the internal type, and every OpenRTB builder takes both wire fields from it:

  • All three builders fill user.eids from it through to_openrtb_user_eids.
  • UserExt has no eids field, so the standard and prebid-server profiles can't write user.ext.eids.
  • APS's ApsUserExt.eids is a copy of the same converted list.

So None there means neither wire field can appear. Every test of the serialized request checks both fields:

  • assert_no_user_eids in every_profile_omits_both_eid_fields_without_eids (all three profiles), aps_request_omits_eids_when_none and the Prebid no-EID test
  • user_eids, which also asserts user.ext.eids is absent, for standard and prebid-server
  • aps_user_eids, which asserts user.ext.eids equals user.eids, for APS

Closes

Closes #1583

Spec

Spec: server-side identity on all adapters, SID-4 (plan task T2 of #1558)

Test plan

  • justrust cargo test-fastly, justrust cargo test-fastly-reuse, justrust cargo test-axum, justrust cargo test-cloudflare, justrust cargo test-spin
  • justrust cargo clippy-fastly, clippy-axum, clippy-cloudflare, clippy-cloudflare-wasm, clippy-spin-native, clippy-spin-wasm, clippy-codegen
  • justrust cargo fmt --all -- --check
  • JS tests: cd crates/trusted-server-js/lib && npx vitest run (Node 24.20.0)
  • JS format and lint: npm run format, npm run lint (Node 24.20.0)
  • Docs format: cd docs && npm run format
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve
  • Other: prettier --check on root and crate markdown (CHANGELOG)

Checklist

  • Feature PRs: spec linked above, ending in a review log of two or more agent review rounds
  • Changes follow AGENTS.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses log macros (not println!)
  • New code has tests
  • No secrets or credentials committed

The bidder, Prebid Server and APS request builders now write resolved EIDs to user.eids instead of user.ext.eids (SID-4). No downstream needs the pre-2.6 placement, so user.ext.eids is no longer written. Non-object EID and UID extensions are dropped because OpenRTB requires ext to be an object.

Wire tests now check both fields: EID-presence tests assert user.eids is set and user.ext.eids is absent, and EID-absence tests assert neither field is present.

Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
The Prebid.js APS adapter (version 2.2.0, /e/pb/bid), which these requests mirror, builds its body with ortbConverter from ortb2 data, and Prebid's User ID module puts EIDs in ortb2 user.ext.eids. APS has therefore only ever seen EIDs there, so APS requests now carry them in both user.eids and user.ext.eids through an APS-only ApsUserExt. Other builders still cannot write user.ext.eids.

Signed-off-by: dhruv8sh <dhruv8sh@proton.me>

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

Summary

Moves resolved EIDs to OpenRTB 2.6 user.eids, retaining the legacy user.ext.eids mirror only for APS. No blocking correctness or security issues found in this PR's delta against its stacked base.

Reviewed commit 0787fd56db65806a5fd3f54e54d4652a6ed8583b against merge base 7bb9e741dd7e3256a2f74c385d30a5a973922570 (feat/s2s-eid-collection-providers).

Verification

Native focused tests passed using cargo test -p trusted-server-core --lib <filter> --locked -j 2:

  • openrtb: 103 passed
  • eids: 78 passed
  • integrations::aps::tests: 39 passed
  • integrations::prebid::tests: 181 passed
  • auction::orchestrator: 99 passed

These test selections overlap. cargo fmt --all -- --check and git diff --check 7bb9e741dd7e3256a2f74c385d30a5a973922570...0787fd56db65806a5fd3f54e54d4652a6ed8583b also passed.

Checked the production transport and current upstream PBS Go/Java EID conversion paths. Live PBS/APS endpoints and local WASM execution were not exercised; consent-denial and wire serialization were verified through separate existing tests rather than a combined end-to-end request.

CI Status

No required checks were reported for this branch. All 24 reported checks passed:

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.

EIDs in OpenRTB 2.6 user.eids; every EID-absence test checks both user.eids and user.ext.eids

2 participants