Repository navigation
Conversation
Prebid treats cookie&html5 as cookie storage plus local storage. SharedID write-back counts it as cookie storage, so the config must accept it and forward it to Prebid unchanged. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
…cid.org The server read a cookie hard-named sharedId and filed it under sharedid.org. It now reads the cookie named by the storage.name of the sharedId managed User ID entry, keeps reading sharedId when no entry has storage, and reads none when Prebid keeps SharedID in local storage only. The admin EIDs echo on every adapter and the template-cache key deny list use the same name. SharedID is filed under the pubcid.org partner, or under sharedid.org when only that one is configured. A record still holding it under sharedid.org is moved to pubcid.org on its next write, and the stored value wins. Bidders receive it once, as source pubcid.org with atype 1, whether it came from the record, the cookies or the auction body, and a sharedid.org browser EID follows the pubcid.org vendor gate. A _pubcid_optout cookie keeps SharedID out of the record, the ingestion preview and bid requests. Storing and sending it already needed TCF Purposes 1 and 4; tests now cover SharedID for both. Closes #1584 Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
storage.namenames, from the managedsharedId/pubCommonIdentry, instead of the hard-wiredsharedIdcookie (SID-1). Prebid'scookie&html5storage type counts as cookie storage. Withhtml5only, no cookie is read._pubcid_optoutcookie stops SharedID from being read into the record, ingested fromts-eids, sent in auction and server-side ad-stack EIDs, or shown as sendable by/_ts/admin/eids(SID-2, cookie part).{source: "pubcid.org", atype: 1}(SID-3). The legacy cookie path now files under thepubcid.orgpartner. A record still holdingsharedid.orgis re-filed on its next real write, and the outbound merge dedupessharedid.organdpubcid.orgas one source.sharedid.orgEID (SID-6).sharedId(WB-5).Stacks on #1489 (
feat/s2s-eid-collection-providers); review only the two commits above it.Choices made for this PR
sharedididentity provider ownspubcid.org.Settings::sharedid_storage()parses the Prebid config on each call. Fastly resolves it once per sandbox inAppState; the other adapters call it only for/_ts/admin/eids.sharedid.orgrides along with a write the row already needs, so it adds no KV write.Changes
crates/trusted-server-core/src/ec/sharedid.rsSharedIdStoragefrom Prebid's config,SharedIdRequest(cookie value and opt-out), canonical source, re-filing and opt-out filtering helperscrates/trusted-server-core/src/settings.rssharedid_storage(); validates the template-cache key cookies against the configured namecrates/trusted-server-core/src/cookies/template_cache_policy.rs,constants.rssharedIdcrates/trusted-server-core/src/ec/finalize.rs,ec/prebid_eids.rs,ec/write_plan.rs,ec/eids.rspubcid.orgatype 1, re-filesharedid.orgcrates/trusted-server-core/src/auction/endpoints.rs,publisher.rscrates/trusted-server-core/src/ec/admin.rssharedid_opted_outcrates/trusted-server-core/src/integrations/prebid.rs,crates/trusted-server-js/lib/src/integrations/prebid/index.tscookie&html5crates/trusted-server-identity-providers/src/lib.rssharedidprovider reads Prebid's configured cookie namecrates/trusted-server-adapter-*docs/guide/*Closes
Closes #1584
Acceptance criteria:
storage.name = "_pubcid"a_pubcidcookie is read and asharedIdcookie is not: for the record on Fastly, and for/_ts/admin/eidson every adapter._pubcid_optoutcookie stops reading, storing and sending here; creation and write-back are Create and write back SharedID in the shared app #1593 (Create and write back SharedID from the EC record #1624). The localStorage-only opt-out needs the injected script to copy it into the cookie, which is T20 (Injected script calls the EC route on consent and merges the IDs into Prebid #1599).ts-eids, body and record carrying the same UUID has exactly one{source: "pubcid.org", atype: 1}EID.Set-Cookie.Spec
Spec: server-side identity on every adapter (SID-1, SID-2, SID-3, SID-6, WB-5); plan task T3.
Test plan
cargo test-fastly && cargo test-fastly-reuse && cargo test-axum && cargo test-cloudflare && cargo test-spincargo clippy-fastly && cargo clippy-axum && cargo clippy-cloudflare && cargo clippy-cloudflare-wasm && cargo clippy-spin-native && cargo clippy-spin-wasm && cargo clippy-cli && cargo clippy-codegencargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute serve--test parity,scripts/lint-wasm-clock.sh,ts dev lint domains --changed-vs feat/s2s-eid-collection-providersChecklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!)