Repository navigation
Extract existing Sourcepoint consent synchronization - #1535
ChristianPavilonis wants to merge 49 commits into
Conversation
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
Server-side reconciliation looks sound: the Origin check plus the JSON content type block cross-site posts, only __gpp/__gpp_sid are replaced (identity cookie, us_privacy and GPC survive), the body bound is applied before parsing, and the endpoint never enters generation, EID ingestion or orphan recovery (those stay on publisher navigation). A null snapshot is not an explicit withdrawal, so a CMP dialog's not-ready phase cannot tombstone anything. One blocking issue on the browser side: consent sync has no enable switch separate from the integration, so deployments without an identity store get a guaranteed-503 POST on every page view.
Blocking
🔧 wrench
- Consent sync posts on every page view where the server can only answer 503 — see inline at
crates/trusted-server-js/lib/src/integrations/sourcepoint/index.ts:315
Non-blocking
🤔 thinking
- The 204 is optimistic; a skipped finalization acknowledges an unprocessed withdrawal — see inline at
crates/trusted-server-core/src/ec/consent_update.rs:191 - Fastly and Axum disagree for bot-gated clients; Fastly/Cloudflare/Spin lack route tests — see inline at
crates/trusted-server-adapter-fastly/src/app.rs:718
CI Status
- CLAUDE.md symlink guard: PASS
- cargo fmt: PASS
- cargo test: PASS
- cargo test (axum native): PASS
- cargo test (cross-adapter parity): PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- cargo check/build/test (spin native + wasm32-wasip2): PASS
- vitest: PASS
- format-typescript: PASS
- format-docs: PASS
- docs-proposal scripts: PASS
- prepare integration artifacts: PASS
- integration tests: PASS
- integration tests (Fastly EC lifecycle): PASS
- browser integration tests: PASS
Retain the public Sourcepoint history above rebuilt native EC. Observe the existing GPP API and carry each real CMP decision in its own bounded first-party snapshot without minting identity or restoring partner IDs. Prepare consent with the shared body reader before EC extraction, preserve runtime origin evidence and typed read-failure status, and deny unclaimed methods and foreign origins locally. Keep current direct clients and response ownership rather than the former ingress/body-preload bridge.
There was a problem hiding this comment.
Superseded by a follow-up review with inline comments: #1535 (review)
PR #1536'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. |
Stop invoking onUnavailable() in GppConsentCapture for transient not-ready protocol states: pending addEventListener registration, GPP 1.0 cmpStatus !== 'loaded' (stub, loading, error), GPP 1.1 signalStatus !== 'ready', and synchronous 1.1 ping returns. Keep onUnavailable() for ready/loaded CMPs with empty or malformed GPP data, failed or throwing commands, and API removal. Prevents the Sourcepoint cookie bridge from clearing mirrored __gpp, __gpp_sid, and _ts_gpp_src cookies or posting a null snapshot to /_ts/consent during the stub phase or mid-session not-ready transitions, preserving stored opt-outs and avoiding premature EID mirror expiration. Addresses PR #1535 review feedback and #1678.
|
Addressed @prk-Jr's follow-up review and #1678 in 13eb9d6. The inline reply at
Re-requesting review from @prk-Jr. |
The consent update test request and its same-origin case used test-publisher.com in absolute URLs, which the URL-host lint rejects on changed lines. The request URI, its Host header and the matching origin now use publisher.example.com together, so the same-origin check still compares like with like, and the foreign-origin case still gets its 403.
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.
|
Round 13: |
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
Follow-up review at 5601ed1ac. The blocking finding from my previous review is resolved: 13eb9d639 stops GppConsentCapture from reporting the stub, loading, registration-pending and not-ready states as unavailable, so a mirrored opt-out now survives the inline __gpp stub and no null snapshot is posted. Fixing it at the protocol boundary rather than with an apiSnapshotSeen flag also keeps the ready-but-empty clearing that #1678 asks for. One non-blocking docs item below.
Prior findings
- 🔧 A stored opt-out is cleared on every page load while the GPP stub is installed (prk-Jr): resolved. The new cookie-bridge test
preserves a mirrored opt-out across the inline GPP stub and deduplicates the ready snapshotasserts the cookies at the stub step, not only after the ready CMP, and checks the exact POST list. I restored each of the four removedonUnavailable()calls one at a time (pending registration, GPP 1.0 non-loaded, GPP 1.1 not ready, synchronous 1.1pingreturn); each restoration fails 2 to 4 Sourcepoint tests, so every site is protected. - Earlier server-side findings and dhruv8sh's nits stay resolved as recorded in my previous review. The three merges of #1536 since then have no conflict resolutions in this PR's files (
git show --remerge-diffis empty), and5b70e917aonly swaps the test host.
Non-blocking
📝 note
- The guide still says an unready API clears the mirror. See inline at
docs/guide/integrations/sourcepoint.md:98.
Checked and not raised
- A CMP that replaces
__gppwithout draining the stub's queuedaddEventListenerleaves registration pending, so this page never mirrors a new decision. That was already true before13eb9d639; the only difference is that the old mirror is now kept instead of cleared, and in an opt-out regime a cleared__gppdoes not carry a withdrawal either. The stub contract requires the CMP to drain the queue, and the queued handoff test covers that path. - GPP 1.0
cmpStatus: 'error'now keeps the last session-cookie mirror. This matches the SDK-failed-to-load case the fix is meant to cover and the TCF mirror's handling of non-loaded states.
CI Status
At 5601ed1ac: 25 checks pass, including vitest, format-typescript, format-docs, cargo fmt, cargo test (axum native), cargo test (cross-adapter parity) and ts dev lint domains (changed lines). Pending: cargo test, browser integration tests, trace runtime and browser acceptance, integration tests, integration tests (Fastly EC lifecycle).
Run locally at this head: the 93 Sourcepoint Vitest cases, Prettier and ESLint on the Sourcepoint sources and tests, and docs Prettier on the guide, spec and plan. All pass.
|
|
||
| The browser module observes the publisher's existing `__gpp` API. With API 1.1 it subscribes to events and reads callback `ping` snapshots only when `signalStatus` is `ready`. With API 1.0 it uses synchronous `ping` and `getGPPData`. It observes late SDK publication without polling, removes replaced listeners, and ignores superseded asynchronous reads. It does not install a CMP or infer permission from Sourcepoint's accept-all flags. | ||
|
|
||
| Actual applicable GPP signals become host-scoped, Secure, SameSite=Lax session cookies named `__gpp` and `__gpp_sid`. The `_ts_gpp_src=sp` marker identifies cookies maintained by this integration. Unready or unusable API state clears only Sourcepoint-owned mirrors. Cookies owned by another writer are not overwritten or cleared. The older localStorage formats remain a compatibility fallback only when no GPP API exists. |
There was a problem hiding this comment.
📝 note — Since 13eb9d639, an unready API no longer clears anything: stub, loading, error and not ready states keep the last mirrored decision, and only a ready CMP with no usable GPP data, a failed command or a removed API clears the Sourcepoint-owned cookies. This sentence still says unready state clears them, which tells an operator debugging a missing __gpp cookie the opposite of what the module does.
| Actual applicable GPP signals become host-scoped, Secure, SameSite=Lax session cookies named `__gpp` and `__gpp_sid`. The `_ts_gpp_src=sp` marker identifies cookies maintained by this integration. Unready or unusable API state clears only Sourcepoint-owned mirrors. Cookies owned by another writer are not overwritten or cleared. The older localStorage formats remain a compatibility fallback only when no GPP API exists. | |
| Actual applicable GPP signals become host-scoped, Secure, SameSite=Lax session cookies named `__gpp` and `__gpp_sid`. The `_ts_gpp_src=sp` marker identifies cookies maintained by this integration. A ready CMP with no usable GPP data, a failed GPP command or a removed API clears only Sourcepoint-owned mirrors. While the CMP is a stub, loading or not ready, the last mirrored decision stays in place. Cookies owned by another writer are not overwritten or cleared. The older localStorage formats remain a compatibility fallback only when no GPP API exists. |
The Sourcepoint guide still said an unready GPP API clears the Sourcepoint-owned consent cookies. Since the transient not-ready fix, only a ready CMP with no usable GPP data, a failed command or a removed API clears them; stub, loading and not-ready states keep the last mirrored decision.
Seed consent sync with the Sourcepoint-owned GPP mirror the page request already carried, so a ready CMP snapshot equal to it no longer triggers a POST /_ts/consent on every page view. The navigation that served the page already reconciled that state. Real changes still post, and a failed update still retries on a later CMP or focus event.
Both adapters' /_ts/consent arms answer without an identity graph or EC finalization, so wiring a record store alone would advertise consent sync to an endpoint that always returns 503. Say so instead of implying the store is sufficient.
Drive POST /_ts/consent through the Axum router with native EC persistence: an opt-out snapshot tombstones the seeded row and expires the EC cookie even when the request still carries permissive GPP cookies, and a grant with no identity is acknowledged without minting an EC.
PR #1536'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, #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 and #1627's Spin store reads and retained runtime coverage. 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 #1540's new head brings the identity chain's commits since #1667 last merged it at afc4f5d, including the EdgeZero repins up to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, main's #1501, #1525's plain HTTP opt-in for auction providers, and this round's owner commits on #1535, #1613, #1616, #1617, #1625, #1627, #1635, #1637 and #1639. Cargo.toml and crates/trusted-server-adapter-axum/Cargo.toml: #1667 pinned EdgeZero at d063a8e7, and the chain now pins rc/identity ef5cbf30, which keeps the client certificate API #1667 uses. The files merge cleanly to the chain's pin, so #1667 no longer carries its own. crates/trusted-server-core/src/auction/mod.rs: #1501 from main, which the chain carries, moved the APS provider test literal into the shared aps_provider_map helper, and #1667 added `mtls: false` to that literal. The resolution calls the helper and adds `mtls: false` to it. docs/guide/auction-orchestration.md: #1525 reworded the endpoint and allow_insecure_http rows of the provider field table, and #1667 added the mtls row below them. The resolution keeps #1525's rows followed by #1667's mtls row. docs/guide/configuration.md: #1525 added the allow_insecure_http row to the provider field table and the plain HTTP warning after the loopback exception, and #1667 added the mtls row and the note that an mtls provider needs an https endpoint. The resolution keeps #1525's table with #1667's mtls row last, and #1525's warning followed by #1667's note. docs/guide/error-reference.md: #1616's owner commit replaced "TLS is always verified" with the adapter and platform TLS policy wording, and #1667 added the outbound client identity bullet after it. The resolution keeps #1616's wording followed by #1667's bullet. crates/trusted-server-core/src/auction/plan.rs (semantic fix): #1525's 23e4bdd removed the local is_false helper from plan.rs and serializes allow_insecure_http through crate::settings::is_false, and #1667's mtls field still named the local helper. The mtls field now uses crate::settings::is_false too. crates/trusted-server-adapter-axum/tests/native_ec.rs (semantic fix): #1536's 9d41f0f added an APS ProviderConfig literal to the Axum native EC tests, and #1667 added the required mtls field to ProviderConfig. The literal now sets `mtls: false`. Cargo.lock matches #1540's new head: next to #1667's, it changes only the EdgeZero package sources (d063a8e7 to ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
|
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. The merge was clean apart from 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. |
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1536's new head ( Checks on this head: no conflict markers; |
Summary
Draft baseline review unit. Not a current-main merge candidate, deployment approval or completed current-head CI claim.
Baseline and sequence
Head:
e2672968a52e7efbad2509204cadab4b2113e3c1. Base:baseline/native-ec-20261110.Historical main anchor:
2dd968aeebeb2cc0d5110115f64e0ad58e2e1d13. Original demo: TS2423a2ed plus separately preserved dirty inputs. Matching EdgeZero: draft431, exact revision83d7a6296d285e135c4ea70021b19e6c8dca7e9f.The user selected compatible-baseline cleanup. Current-main integration with EdgeZero462 and the authenticated-forwarder incompatibility are deferred. Preserve current-main PR1525/1526 ready and1527/1528 draft, with their existing bases. No excluded1499 or independent1506 implementation, relay/privacy experiment, new transport fallback, group/codec/phase design or operational deployment is included.
Changes
Closes
Refs #1530. This unit completes one part of the baseline extraction and does not close the overall tracker on its own.
Refs #1678. Commit
13eb9d639stopsGppConsentCapturefrom firingonUnavailable()during transient CMP stub, registration-pending, and not-ready states so mirrored GPP cookies are preserved and no spuriousnullsnapshot is posted to/_ts/consent; the final Prebid EID mirror browser check runs once merged forward intorc/identity.Spec
Not a new feature. This is extraction of existing demo behavior and bounded build/caller corrections. Original native and EC storage design/review records remain in the baseline where applicable; they are not presented as approval of later combined source. No new forwarding, consent, timer or provider policy is designed here.
Test plan
Sourcepoint68 JS cases pass, full JS lint/format pass, Core3016 and native suites/strict lint pass. This is the existing e7c7f57 delta, not new consent policy or parked Prebid relay fixes.
The b67ffc6 baseline checkpoint has passing documented local gates: Fastly/default/reuse/native/Cloudflare/Spin suites, all adapter strict lint lanes, 17 cross-adapter parity cases, 1252 JS cases, CLI suites, formatting, clock/digest/proposal checks and changed-lines domain lint. Passing checks at121ebcc36 are reused only for unchanged relevant inputs; the final follow-up covers the CLI test-import and documentation-only corrections. These results are not a substitute for this PR's current-head hosted checks.
Checklist
Operational Terraform remains in trusted-server-deployer. Local checks and prototype tests do not qualify cloud access, fleet durability or a live publisher.
Hosted docs-build correction
The first hosted format-docs job caught an additional site-build gate that the original local formatter checkpoint had not run: a relative link from the native EC guide to a Terraform example outside the site. Native EC correction8b11dbad3 replaces it with the plain repository path; no dead-link check is disabled. That docs-only correction is carried through the existing upper PR identities. Native EC and final integration8985b111 both pass docs ESLint and VitePress build; the final docs formatter also passes. Runtime, dependency, image-build-context and test inputs are unchanged from b67ffc6, so their prior exact-input proofs are reused. Hosted current-head checks still control readiness.
Startup negative-probe correction
A hosted native EC case failed the no-listener probe while its child logged the expected startup validation failure. The old log has no socket endpoints, so the failure's exact subtype is not claimed confirmed. A separate controlled Linux reproduction demonstrates a successful TCP self-connection with no listening server. Native correction8490c691d distinguishes equal local/peer endpoints from a real listener; actual socket controls prove the self-connection is excluded and a real listener is still detected. Nonzero exit, expected diagnostic, secret-redaction and the original startup deadline remain required. This changes only the acceptance fixture, not production admission, transport or trust.
The earliest native unit and final9356c557 default/all-feature acceptance checks and strict lint pass, including both controls and the original failure case. Ignores remain explicit; earlier separately executed celld proof is not relabeled as a new ignored-case run. Correction is merged upward through existing PR identities without force-pushing or retargeting. Current-head hosted checks must pass; the old failure is retained rather than rerun-only waived. Runtime/API/dependency inputs remain unchanged. A fresh exact9356 producer build and real runtime smoke now pass: image
sha256:65a735d38e9dbc0573d0f6068a8b261bd202c43aea05085c2b2d6bccc91ebdbd, linux/amd64 UID/GID10001, including startup rejection and in-flight SIGTERM drain. Prior b67 image receipts remain separate; no image was pushed. All local parent runners are complete.Browser CI host compatibility
Preserved older browser failures show Playwright1.58.2 rejecting ubuntu-latest's new Ubuntu26.04 image before browser installation; later missing-executable failures are consequences, not passing browser tests. Nativeb1216763a pins only the browser job to ubuntu-24.04, leaving dependency versions, tests and assertions unchanged. Direct Actionlint1.7.12 passes at the owning native and final integration points; the first shim-only attempt could not run because no global version was configured, and is not counted as lint proof. No global tooling was changed. The only9356 ->ee7 delta is this workflow host/comment; runtime, Cargo, docs, tests and Docker-context inputs are unchanged. Actual browser execution on the supported hosted runner remains pending and must pass before readiness. No waiver or browser skip.
Reconciliation refresh above the new PR 1506 head
Merge-forward head
2cc297bee412ba0ab21cf68f45b9ce4efef79507retains original public0666a9b4bde2719b3d15b40b1b0d2dfb4848bf64, previous local candidateec7c946ddab7c5a03f0fef4ee16e9e6078027abcand updated parentd17472fd39e3ebfaaad7df432b7dce1e5bf9b990. The original feature patch is unchanged. Aram's #1516 code/tests/spec are preserved upstream rather than duplicated as another owned production port. The existing PR identity, feature boundary and readiness remain intact.Fresh shared-root and combined RC qualification passes on the refreshed source. Reused JS/Chrome/storage/wrapper/Terraform evidence is explicitly fingerprinted, not claimed as a new execution. Source-image proof is bound to refreshed #1539, not a new RC release. Fresh hosted/macOS, digest-backed wrapper/RC images, other external browser/framework lanes and live AWS/publisher/CMP acceptance remain unverified. Ignored/unexecuted cases and original failed receipts are not counted as passes. Historical claims above remain bound to their named old inputs. No tag, registry publication or deployment is included.
Published snapshot; newer upstream integration pending
Published deliberately for review from the qualified #1506 checkpoint
57d7c6ad8db43601ef31c1e1d1615e6dd2aa6a6a. At publication the moving author branch was at628474ec4a8cee8361a6927ae6b79b68fdd33a55. Newer upstream bounded-response handling, per-profile RTB caps and Sourcepoint changes are not incorporated or qualified in this snapshot. Further merge-forward reconciliation and conflict resolution may be needed before merge. Local results above describe this exact qualified source, not a merge with the newer base or a release.