Repository navigation
Carry Sourcepoint TCF consent to Trusted Server - #1557
ChristianPavilonis wants to merge 11 commits into
Conversation
prk-Jr
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES at 76e1dd5f60.
Two blocking findings are detailed inline:
- [P1] Same-day stale snapshots can undo withdrawal —
tcf_mirror.ts:83–85. - [P2] Listener cleanup calls the retired queueing stub —
tcf_mirror.ts:115.
Verification: all 39 Sourcepoint tests passed under pinned Node 24.20.0; separate JSDOM probes reproduced both findings. All 30 reported GitHub checks passed. No live Sourcepoint/browser deployment was exercised; unrelated portions of the large Prebid file were sampled.
Both corrections are prose proposals; no implementation changes or one-click suggestions are included.
aram356
left a comment
There was a problem hiding this comment.
Summary
This carries a Sourcepoint TCF decision from __tcfapi into the host-only __Host-ts-tcf cookie, then falls back to it in consent extraction and Prebid cookie forwarding. The Rust side is consistent: every consent caller goes through tcf_consent_cookie, and the tests catch all five selection and precedence mutations I tried (swapped precedence, no fallback in the selector, extraction or Prebid, and the bridge name on the wire). The browser mirror's ordering is not sound yet, because it relies on a timestamp that only carries the day.
2 of the inline comments below carry a one-click GitHub
suggestion. Use Commit suggestion (or Add suggestion to batch) to apply them. The rest describe the fix in prose because it spans files or lines outside the diff.
Blocking
🔧 wrench
- The stale-snapshot guard orders decisions by a day-level timestamp: see inline at
crates/trusted-server-js/lib/src/integrations/sourcepoint/tcf_mirror.ts:77-88
Non-blocking
♻️ refactor
- The same-day denial clause has no test (suggestion): see inline at
crates/trusted-server-js/lib/test/integrations/sourcepoint/tcf_mirror.test.ts:110 - Nothing tests that
index.tsinstalls the mirror: see inline atcrates/trusted-server-js/lib/src/integrations/sourcepoint/index.ts:288
🤔 thinking
- A stale
euconsent-v2hides the live decision: see inline atcrates/trusted-server-js/lib/src/integrations/sourcepoint/tcf_mirror.ts:58 - Removing a listener through a retired stub does nothing: see inline at
crates/trusted-server-js/lib/src/integrations/sourcepoint/tcf_mirror.ts:116
⛏ nitpick
- Give the mirror its own docs heading (suggestion): see inline at
docs/guide/integrations/sourcepoint.md:86-99
Cross-cutting / body-level findings
- ⛏ Docs and doc comments still name only
euconsent-v2as the TC source.docs/guide/edge-cookies.md:94lists the request-local consent signals without__Host-ts-tcf. The module doc atcrates/trusted-server-core/src/consent/mod.rs:16and the field docs atcrates/trusted-server-core/src/consent/types.rs:35and:110say the TC string comes fromeuconsent-v2.docs/guide/integrations/cookie-forwarding.md:7-11anddocs/guide/integrations/prebid.md:139could add that the bridge cookie is forwarded to PBS aseuconsent-v2. - ⛏ Other mirror behavior that no test pins. Each of these mutations leaves all tests green: removing the
target.top !== targetguard; droppingPath=/orSameSite=Laxfrom the cookie attributes (browsers reject a__Host-cookie withoutPath=/, but jsdom accepts it); removing theloadorfocusre-subscribe hooks; droppingunsubscribe()after a failed callback, thesubscribingre-entrancy guard, thelistenerIdcheck inremoveListener, orunsubscribe()in the disposer; and lowering the 3600-character limit to 3599. A framed-page test and a spy on thedocument.cookiesetter would cover the first two.
CI Status
- integration tests (Fastly EC lifecycle): PASS
- trace runtime and browser acceptance: PASS
- browser integration tests: PASS
- integration tests: PASS
- CodeQL: PASS
- prepare integration artifacts: PASS
- CLAUDE.md symlink guard: PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- release scripts: PASS
- docs-proposal scripts: PASS
- format-docs: PASS (required)
- format-typescript: PASS (required)
- cargo fmt: PASS (required)
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- Analyze (actions): PASS
- cargo test (axum native): PASS
- CI Node pin guard: PASS
- Analyze (rust): PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- worker-deadlines (spin): PASS
- Analyze (javascript-typescript): PASS
- HTML EOF runtime (Fastly): PASS
- vitest: PASS
- cargo test (cross-adapter parity): PASS
- worker-deadlines (cloudflare): PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- cargo test: PASS (required)
- ts dev lint domains (changed lines): PASS
- Analyze (python): PASS
- Analyze (javascript-typescript): PASS
- Branch is 3 commits behind
main(auction telemetry only) and merges cleanly.
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
Adds a Sourcepoint TCF mirror (__Host-ts-tcf) so a settled GDPR decision reaches Trusted Server when the CMP does not write euconsent-v2, with canonical-first selection on the server and canonical naming for Prebid forwarding. Precedence, stale-snapshot ordering, and cookie attribute safety all check out.
Non-blocking
⛏ nitpick
- Cookie name duplicated across Rust and JS — see inline at
crates/trusted-server-js/lib/src/integrations/sourcepoint/tcf_mirror.ts:3
👍 praise
- Thorough mirror tests — see inline at
crates/trusted-server-js/lib/test/integrations/sourcepoint/tcf_mirror.test.ts:1
CI Status
- All 30 reported checks: PASS
#1487's head 64674f9 stacks on #1526's b53c6e2 and merged #1557's 76e1dd5; each merge resolved its own conflicts, so this merge needs no resolution. It brings server-side identity provider collection with one page-load write (#1567), with lookups on EdgeZero's outbound client and the KV code on #1526's async store.
TC strings record only the day of a decision, so same-day conflicts between tabs and navigations were settled by a tie rule that could keep a stale grant after withdrawal or a stale denial after a new grant. Record when the mirror was last written in a host-only session cookie, `__Host-ts-tcf-at`, and ignore a CMP snapshot only when another document wrote after this one installed. A user action on the page always applies; the registration-time callback is treated as a snapshot even when it replays an earlier action. Adopt a listener the IAB stub hands to the live CMP instead of registering a second one, so cleanup reaches the CMP that owns the listener ID. Log when a leftover `euconsent-v2` differs from the live decision, document the mirror under its own heading, and name the mirror wherever the TC source is described.
|
Review follow-up in 5d5b070. Inline points are answered in their threads; this covers the points from @aram356's review body. Docs and doc comments naming only Mirror behavior no test pinned. Now covered: the framed-page guard, the cookie attributes (via a spy on the The Checks: Sourcepoint Vitest (51), full Vitest suite (3,322 passed, 1 skipped), ESLint, Prettier for JS and docs, |
PR #1557 moves from main onto PR #1662's branch, the top of the identity chain trunk. PR #1662's head brings the identity integration chain as of round 12 wave A, which already carries #1557's earlier head 76e1dd5. This merge adds #1557's new commit 5d5b070, which orders Sourcepoint TCF mirror writes by browser time. docs/guide/integrations/sourcepoint.md: #1557 renamed the heading above the TCF mirror text from "Cookie Forwarding and Caching" to "TCF Consent Mirror", added the `__Host-ts-tcf-at` and leftover `euconsent-v2` paragraphs, and moved "Cookie Forwarding and Caching" down to the forwarding paragraphs. The chain added a "Consent capture" section for the GPP observer and `POST /_ts/consent` just above that heading. The resolution keeps the chain's "Consent capture" section, then #1557's "TCF Consent Mirror" heading and text, then its "Cookie Forwarding and Caching" heading.
One octopus merge of the round 12 tips into rc/identity c3e3366. It is a single octopus because the RC already holds every sibling's old head, so each tip's new head merges in alongside the others rather than as a chain of merges. The tree is the automatic merge of the RC and all tips, with no resolution: every tip pair, their union and the merge into the RC are clean. Tips, in parent order after the RC: - PR #1503 at 4225024 - PR #1653 at 4bd4903 - PR #1654 at 95cf3e8 - PR #1655 at 05c509d - PR #1622 at afe5217 - PR #1660 at c1a05d7 - PR #1666 at 108b122 - PR #1659 at 5fb8190 - PR #1709 at 6d152f6 - PR #1710 at dcceeee - PR #1713 at cae7801 - PR #1557 at 302e972 PR #1659 sits above PR #1718, so it carries PR #1714, PR #1717 and PR #1718.
|
Round 12 identity realignment:
The base moved from Each merge message says what it carries and how any conflict was resolved. |
PR #1662's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
It brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's and #1540's URL-host lint fixes, and #1622's move of the new GPP bridge tests into its split test file, carried up to every tip: #1653, #1654, #1655, #1622, #1660, #1666, #1659, #1709, #1710, #1713 and #1557. #1503 is already contained. The octopus tree is the conflict-free union of the tips.
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
Follow-up pass at f049c7a5f. Both findings from my earlier review are fixed in 5d5b07007, and I found nothing new that blocks. The PR's own diff against feat/1598-ec-route-fastly is that commit: the browser mirror, its tests, and doc and doc-comment updates. The Rust changes are doc comments only.
Earlier findings, now resolved
- [P1] Same-day stale snapshots can undo withdrawal. The mirror no longer orders decisions by the TC string's day-level
LastUpdated. The__Host-ts-tcf-atmarker records when the mirror was last written. A snapshot is dropped only when another document wrote after this one installed, and a user action in this document always applies. The registration-time callback counts as a snapshot, so a re-subscription cannot replay an earlier action over a newer withdrawal. - [P2] Listener cleanup calls the retired queueing stub. A subscription made on the IAB stub (detected with
ping) is adopted by the live CMP when it delivers the queued listener, and it is removed through that CMP. A subscription made on a live CMP is still removed through its own API.
Verification
- Sourcepoint Vitest: 105 tests pass, including the 45 in
tcf_mirror.test.tsandindex.test.ts.npx prettier --checkand ESLint are clean on the Sourcepoint sources and tests. Docs Prettier (docs/.prettierrc) andcargo fmt --checkpass. Local Node is 24.12.0; the repository pins 24.20.0. - Mutation controls, each run against both test files:
- Ignoring the marker (
isStaleSnapshotalways false) fails 4 tests. - Treating this document's own write as another tab's fails the same-day denial test.
- Letting a registration-time
useractioncompletebypass the snapshot rule fails the replay test, and so does never marking a subscription as primed. - Treating every
useractioncompleteas a snapshot fails the stale tab's own user-action test. - Disabling stub adoption or stub detection fails both IAB-stub handoff tests.
- Leaving the marker in place on clear fails 5 tests.
- Only the
>to>=boundary on the install time survives, which needs a write in the same millisecond.
- Ignoring the marker (
- Traced, not executed: the stub adoption heals if the live CMP drains the stub's queue before it assigns
__tcfapi. The next callback re-readslistenerIdand removes the retired listener through the live CMP.
Non-blocking
Aram's optional hardening items that the author left unpinned (the load hook alone, unsubscribe() after a failed callback, the re-entrancy guard, the listenerId check in removeListener, and the 3600-character boundary) remain optional. I am not re-raising them.
CI Status
At f049c7a5f, Native provider acceptance script passes and the remaining 29 checks are still pending after the latest stack merge. None has failed.
PR #1662's new head brings #1662's consent-string comment on the EC route fixture, plus #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, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage, #1535's Sourcepoint consent mirror deduplication and consent update coverage, #1636's stronger after-response body and drain checks, #1626's enforcement of stored and carried provider opt-outs, #1656's strict browser gate wording and #1661's grouped QUIC JA4 fixture. 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.
PR #1503 at 1d51b78: Add ts ec show and ts ec eids admin diagnostic commands PR #1653 at f217902: Clarify and verify the Axum local config handoff PR #1654 at e4e68bb: Verify pending record writes drain within shutdown grace PR #1655 at 7d0cdb2: Configure EC lifetime and renew it on eligible visits (DEC-13) PR #1659 at bd707f2: Verify geo consent paths on Axum and Fastly PR #1660 at 87c52cd: Retry an after-response write that loses its CAS PR #1666 at b1d7062: Verify identity gates and provider deadlines on Axum PR #1710 at 3d33359: Apply pull-sync consent checks to identify PR #1557 at 3982143: Carry Sourcepoint TCF consent to Trusted Server PR #1667 at f9ac6bb: Present a client certificate on auction providers that set mtls PR #1607 at b3a0b09: Send the resolved client IP to the publisher origin PR #1709 at 635f06a: Keep the EC out of bid request IDs and gate user.id on EID consent PR #1713 at e5f4d05: Apply consent rules to first-party click redirects PR #1622 at dd2ee39: Report CMP consent to the EC route and merge its answer into Prebid
|
Round 15 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
|
Cascade of #1533's Axum startup-test port fix ( |
…tegration chain
|
Merged #1627's runtime KV removal ( At the maintainer's request, that commit removes the generic runtime KV store Only that commit was merged, not the base branch's new head. Conflicts were resolved in Checks on this head: no reference to the removed store remains and |
|
Round 17 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
PR #1503 at 6a8797e: Add ts ec show and ts ec eids admin diagnostic commands PR #1557 at a435778: Carry Sourcepoint TCF consent to Trusted Server PR #1607 at 07086f2: Send the resolved client IP to the publisher origin PR #1627 at 5b7fc3d: Wire declared stores and document unsupported Axum KV PR #1636 at d838931: Drain Axum after-response identity tasks on SIGTERM PR #1653 at 5b86d9b: Clarify and verify the Axum local config handoff PR #1654 at be495b3: Verify pending record writes drain within shutdown grace PR #1655 at 888c5f1: Configure EC lifetime and renew it on eligible visits (DEC-13) PR #1659 at 7b1d4a7: Verify geo consent paths on Axum and Fastly PR #1660 at 64a1baa: Retry an after-response write that loses its CAS PR #1667 at 1359722: Present a client certificate on auction providers that set mtls PR #1709 at bc43a3e: Keep the EC out of bid request IDs and gate user.id on EID consent PR #1710 at dc728a1: Apply pull-sync consent checks to identify PR #1713 at ffa7597: Apply consent rules to first-party click redirects PR #1722 at 070e2b0: Use applicable GPP sections from the CMP instead of header sections PR #1666 at 4720b0b (Verify identity gates and provider deadlines on Axum) arrives through #1659, and PR #1622 at c878e6e (Report CMP consent to the EC route and merge its answer into Prebid) arrives through #1722. Every other chain PR arrives through the tips above. The tree is the conflict-free union of these tips and carries no resolution of its own.
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1662's new head ( Checks on this head: no conflict markers; |
Summary
Sourcepoint can expose a GDPR TCF decision through its browser API without writing
euconsent-v2. Trusted Server then sees no storage grant on the page request and cannot issue an Edge Cookie.euconsent-v2cookie precedence and use the existing server consent rules.euconsent-v2as the outbound name for the selected TC signal in Prebid cookie forwarding modes.Changes
crates/trusted-server-js/lib/src/integrations/sourcepoint/index.tscrates/trusted-server-js/lib/src/integrations/sourcepoint/tcf_mirror.tscrates/trusted-server-js/lib/test/integrations/sourcepoint/tcf_mirror.test.tscrates/trusted-server-core/src/{constants,cookies}.rscrates/trusted-server-core/src/consent/{extraction,mod}.rscrates/trusted-server-core/src/integrations/prebid.rsdocs/guide/integrations/sourcepoint.mdCloses
Closes #1568.
Spec
Not a feature.
Test plan
euconsent-v2path; the next eligible navigation issued an Edge Cookie. This validated the transport gap. The permanent bridge was not deployed.git diff --check.--maxWorkers=2).Checklist
unwrap()added to production code