Skip to content

Use applicable GPP sections from the CMP instead of header sections - #1722

Open
ChristianPavilonis wants to merge 15 commits into
feat/1599-ec-route-consent-scriptfrom
fix/1686-gpp-applicable-sections
Open

ChristianPavilonis wants to merge 15 commits into
feat/1599-ec-route-consent-scriptfrom
fix/1686-gpp-applicable-sections

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Previously, Trusted Server picked which sections of a Global Privacy Platform (GPP) string apply by reading every section listed in the GPP header, and only read the __gpp_sid cookie when decoding failed. Because a single GPP string can hold sections for multiple regions (for example, both European Union Transparency & Consent Framework (TCF) section 2 and US National section 7), US readers with __gpp_sid=7 were still treated as GDPR traffic, had all US sections combined instead of only the active one, and forwarded the full header list in OpenRTB regs.gpp_sid. Meanwhile, parsing __gpp_sid as unsigned integers dropped the Consent Management Platform (CMP) sentinel -1 ("no section applies"), and the Osano browser mirror stripped -1 before writing the cookie.

  • Use the CMP's __gpp_sid cookie (applicableSections) as the governing section list for EU TCF applicability, US opt-out evaluation, and OpenRTB regs.gpp_sid forwarding, falling back to the decoded GPP header only when __gpp_sid is absent or [0].
  • Preserve signed section IDs (-1..=65535) end-to-end so [-1] explicitly disables GPP rules (letting geolocation decide with no GPP signal) and forwards regs.gpp_sid: [-1].
  • Update the Osano and Sourcepoint browser mirrors on main to preserve -1 and 0 in __gpp_sid, and remove Sourcepoint's fallback that copied header section IDs from consentStrings into __gpp_sid.
  • Omit regs.gpp and regs.gpp_sid in the Prebid Server and Standard OpenRTB profiles when regs.gdpr = 1 outside a US-state jurisdiction and the governing sections exclude TCF section 2, so Prebid Server keeps per-vendor TCF enforcement (see the PBS-Go decision below).

Scope

This PR targets main and covers the shared Rust consent/OpenRTB pipeline, the two GPP browser mirrors on main (Osano and Sourcepoint), their integration guides, and the design spec and implementation plan.

Design decisions

  • Prebid Server (PBS-Go) GDPR + non-TCF gpp_sid conflict: Option B, scoped to non-US jurisdictions. PBS-Go gdpr.GetGDPR returns "GDPR does not apply" whenever a non-empty regs.gpp_sid lacks 2, ignoring regs.gdpr = 1 and skipping per-vendor TCF enforcement, which only PBS performs. With the Osano mirror now writing __gpp_sid=-1, an EU visitor with a standalone euconsent-v2 could reach PBS as gdpr=1, gpp_sid=[-1].
    • The Prebid Server and Standard profiles now omit both regs.gpp and regs.gpp_sid (top-level and regs.ext) when regs.gdpr = 1, the jurisdiction is not UsState, and gpp_section_ids is non-empty without 2. regs.gpp is dropped too because PBS-Go GetConsent prefers a GPP-embedded TCF section over user.consent.
    • US-state exemption: a standalone euconsent-v2 sets gdpr_applies for US visitors whose CMP uses TCF in the US. There the CMP-declared US section (for example [7]) governs, and PBS-Go correctly applies US rules, so UsState requests keep GPP.
    • APS is not Prebid Server and keeps forwarding GPP verbatim.
  • Proxy mode normalizes __gpp_sid with the same resolver as decode mode (for example [-1, 7] → [7], [-1, 0] → none); [-1], [0], and positive lists are unchanged.
  • Stale __gpp_sid: when an explicit __gpp_sid shares no section with the decoded __gpp header, the mismatch is logged at info.
  • Two noted departures from Choose the governing GPP sections from the CMP's applicable sections #1686 wording (documented in the spec):
    1. For a US request with header [2, 7] and __gpp_sid=7, existing build_regs emits regs.gdpr = Some(false) (0, not 1) for known US jurisdictions rather than omitting regs.gdpr (None remains reserved for unknown jurisdiction).
    2. When __gpp_sid=0 and __gpp decodes a valid header (for example [2, 7]), regs.gpp_sid forwards the header fallback [2, 7] while ConsentContext.applicable_sections retains Some([0]). (In proxy mode or when __gpp does not decode, [0] is forwarded as received.)

Changes

File Change
crates/trusted-server-core/src/consent/types.rs Added ConsentContext.applicable_sections (Option<Vec<i32>>), switched gpp_section_ids to Option<Vec<i32>>, and updated is_empty() and doc comments.
crates/trusted-server-core/src/consent/gpp.rs Parsed __gpp_sid as i32 in -1..=65535, added GppApplicability classification, scoped decoding via decode_gpp_string_with_applicability, the shared resolve_gpp_section_ids resolver (with the stale-cookie info log), gpp_sid_excludes_tcf_eu, and unit tests.
crates/trusted-server-core/src/consent/mod.rs Classified __gpp_sid once in build_context_from_signals, scoped GPP decoding and gdpr_applies to governing sections, normalized proxy mode with the shared resolver, added regs_gpp_fields (PBS-Go Option B), and added pipeline tests.
crates/trusted-server-core/src/openrtb.rs Switched RegsExt.gpp_sid from Option<Vec<u16>> to Option<Vec<i32>> and added -1 serialization coverage.
crates/trusted-server-core/src/integrations/prebid.rs Forwarded Option<Vec<i32>> in build_regs via regs_gpp_fields, allowed -1 tokens in comma/whitespace __gpp_sid cookie normalization, and added regression tests (including GDPR/US-state Option B coverage).
crates/trusted-server-core/src/auction/openrtb.rs Updated Prebid, Standard, and APS profile build_regs helpers to pass Vec<i32> directly; Prebid and Standard use regs_gpp_fields.
crates/trusted-server-core/src/auction/openrtb/tests.rs Added gpp_sid: [-1], GDPR + non-TCF gpp_sid, and US-state TCF + [7] coverage across Standard, Prebid Server, and APS OpenRTB profiles.
crates/trusted-server-core/src/integrations/aps.rs Updated the test-only legacy APS build_regs parity helper for Option<Vec<i32>>.
crates/trusted-server-js/lib/src/integrations/osano/index.ts Updated shouldWriteGppSid to write -1 and 0 sentinels (valid integers in -1..=65535) instead of stripping -1.
crates/trusted-server-js/lib/test/integrations/osano/index.test.ts Updated Osano tests to verify -1 and 0 write __gpp_sid while empty or missing lists clear it.
crates/trusted-server-js/lib/src/integrations/sourcepoint/index.ts Validated applicableSections integers in -1..=65535 on both payload shapes and removed the sectionIdsFromConsentStrings header-ID fallback.
crates/trusted-server-js/lib/test/integrations/sourcepoint/index.test.ts Added Sourcepoint tests for -1, 0, out-of-range filtering, and clearing __gpp_sid when only consentStrings exist.
docs/guide/integrations/osano.md Documented __gpp_sid mirroring for -1 and 0 sentinels and clearing on empty/absent lists.
docs/guide/integrations/sourcepoint.md Documented GPP localStorage mirroring, -1/0 handling, and clearing __gpp_sid when applicableSections is absent.
docs/superpowers/specs/2026-12-01-1686-gpp-applicable-sections-design.md Added the design specification, resolution matrix, tradeoffs, and the PBS-Go Option B decision with its US-state exemption.
docs/superpowers/plans/2026-12-01-1686-gpp-applicable-sections.md Added the task-by-task implementation plan and recorded verification results.

Closes

Part of #1686 (remaining four rc/identity-only items will close #1686 in a follow-up once this merges into rc/identity).

Spec

Spec: docs/superpowers/specs/2026-12-01-1686-gpp-applicable-sections-design.md

Test plan

  • cargo test-fastly && cargo test-axum (see note below: cargo test-axum passed and both Fastly WASM test binaries compiled cleanly, while local Viceroy execution is blocked by host viceroy 0.17.0 vs pinned 0.22.0)
  • cargo clippy-fastly && cargo clippy-axum (plus all other clippy aliases: cloudflare, cloudflare-wasm, spin-native, spin-wasm, cli, codegen, and template_build_digest)
  • cargo fmt --all -- --check
  • JS tests: cd crates/trusted-server-js/lib && npx vitest run (80 files, 3,303 tests passed, 0 type errors)
  • JS format: cd crates/trusted-server-js/lib && npm run format
  • Docs format: cd docs && npm run format (plus Prettier check on Markdown outside docs/)
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1 (debug WASM test builds compiled cleanly; CI runs release WASM)
  • Manual testing via fastly compute serve
  • Other:
    • Native trusted-server-core unit tests (cargo test -p trusted-server-core --target x86_64-unknown-linux-gnu --lib: 3,416 passed, 0 failed, 2 ignored)
    • cargo test -p trusted-server-core --test template_build_digest, cargo test -p trusted-server-openrtb --target x86_64-unknown-linux-gnu, cargo test-cloudflare, cargo test-spin, and parity integration tests (29 passed)
    • cd crates/trusted-server-js/lib && npm run build (13 modules)
    • scripts/lint-wasm-clock.sh
    • cargo run --manifest-path crates/trusted-server-cli/Cargo.toml --target x86_64-unknown-linux-gnu --bin ts -- dev lint domains --changed-vs origin/main
  • Re-run after the review follow-up commit (Option B, proxy normalization, stale-cookie log; Rust and spec/plan docs only, no JS changes): cargo fmt --all -- --check; clippy-fastly, clippy-axum, clippy-cloudflare, clippy-cloudflare-wasm, clippy-spin-native, clippy-spin-wasm; native trusted-server-core unit tests (3,421 passed, 0 failed, 2 ignored); cargo test-axum, cargo test-cloudflare, cargo test-spin; parity (29 passed); Prettier check on the spec and plan. cargo test-fastly compiled but local Viceroy execution is still blocked by host viceroy 0.17.0.

Checklist

  • Feature PRs: spec linked above (review rounds incorporated; PBS-Go Option B decided with a US-state exemption)
  • 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

prk-Jr and others added 7 commits November 30, 2026 21:01
PR #1714 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.

The merge is textually clean.

crates/trusted-server-core/src/ec/consent_update.rs (merged clean, failed to compile): the chain's consent-update snapshot test reads the decoded US opt-out through the old GppConsent.us_sale_opt_out field, which #1714 renames to us_opt_out. The resolution renames that one test reader. The test's opt-out snapshot sets sale opt-out, so its expectation is unchanged.
PR #1662'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.
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.
PR #1662's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
- Drop regs.gpp and regs.gpp_sid in the Prebid Server and Standard
  profiles when regs.gdpr = 1 outside a US-state jurisdiction and the
  governing sections exclude TCF EU section 2. PBS-Go treats a non-empty
  gpp_sid as authoritative and would otherwise skip per-vendor TCF
  enforcement. US-state requests and APS keep forwarding GPP.
- Share gpp::resolve_gpp_section_ids between proxy and decode mode so
  proxy mode drops stray sentinels (for example [-1, 7] -> [7]).
- Log at info when an explicit __gpp_sid shares no section with the
  decoded __gpp header.
- Keep a single GPP_SECTION_ID_TCF_EU_V2 constant and clarify the
  gpp_section_ids doc comment.
- Record the Option B decision in the spec and plan.
@ChristianPavilonis
ChristianPavilonis marked this pull request as ready for review December 2, 2026 16:31
@ChristianPavilonis ChristianPavilonis self-assigned this Dec 2, 2026
@ChristianPavilonis
ChristianPavilonis requested review from aram356, dhruv8sh and prk-Jr and removed request for prk-Jr December 2, 2026 17:15

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

This PR makes the CMP's __gpp_sid (applicableSections) decide which GPP sections are governing. -1 and 0 sentinels are kept, EU TCF and US opt-out decoding are limited to the applicable sections, and regs.gpp/regs.gpp_sid are left out of non-APS OpenRTB requests when GDPR applies but the governing sections exclude TCF (to avoid PBS-Go's GetGDPR override). The u16→i32 type change reaches every consumer. Classification, resolution and the proxy-vs-decode normalisation match each other. The new tests cover the sentinel matrix, disjoint stale-cookie cases, proxy mode and the PBS conflict case. One small docs inaccuracy, below.

Non-blocking

📝 note

  • Osano doc says [0] avoids the header fallback, but the server falls back to the header for [0]. See inline at docs/guide/integrations/osano.md:27.

👍 praise

  • Fail-closed handling of a stale or disjoint __gpp_sid under a GDPR geo. The log::info! mismatch diagnostic in resolve_gpp_section_ids and the tests in consent/mod.rs that pin down the behaviour make this easy to reason about.

| `euconsent-v2` | TCF string from `__tcfapi` |
| `_ts_consent_src` | Ownership marker set to `osano` |

When Osano reports `applicableSections` as `[-1]` (no section applies) or `[0]` (undetermined), the mirror writes `__gpp_sid=-1` or `__gpp_sid=0` so Trusted Server can apply the CMP's governing-section decision rather than falling back to the GPP header. When `applicableSections` is empty or absent, `__gpp_sid` is cleared.

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.

📝 note: This sentence says both [-1] and [0] let Trusted Server "apply the CMP's governing-section decision rather than falling back to the GPP header". That's only true for -1. classify_applicable_sections maps [0] to GppApplicability::FallbackToHeader, so a 0 cookie does fall back to the decoded __gpp header sections. It is only forwarded as [0] when there is no decodable header. Suggested wording:

Suggested change
When Osano reports `applicableSections` as `[-1]` (no section applies) or `[0]` (undetermined), the mirror writes `__gpp_sid=-1` or `__gpp_sid=0` so Trusted Server can apply the CMP's governing-section decision rather than falling back to the GPP header. When `applicableSections` is empty or absent, `__gpp_sid` is cleared.
When Osano reports `applicableSections` as `[-1]` (no section applies) or `[0]` (undetermined), the mirror writes `__gpp_sid=-1` or `__gpp_sid=0`. Trusted Server treats `-1` as the CMP's explicit decision that no GPP section governs, and treats `0` like an absent list, falling back to the section IDs in the GPP header. When `applicableSections` is empty or absent, `__gpp_sid` is cleared.

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.

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

Reviewed 68dca95df5ceb2f489dbd2617e5e2d8d503751ab against ab5c24f73f84bd226fe3c16cfe215a86f56d9b5b.

One blocking privacy-signal regression: the US exemption uses configured privacy-state membership, so country-only US geolocation loses applicable GPP signals. See inline.

Local verification used Rust 1.98.1 and Node 24.20.0: 137 consent tests, 50 GPP-related tests, and 49 browser tests passed. Six independent broken controls failed at the intended assertions. Relevant hosted Rust, adapter, parity, JS, clippy, and release-build checks passed for the reviewed pairing. The new US regression probe failed on the reviewed implementation and passed when restoring previous forwarding behavior.

The reproduction exercised native production consent processing and request serialization using Cloudflare's source-established country-only geolocation shape. Expiration checking was disabled for the static TCF fixture. No live Worker, CMP, or PBS deployment was exercised. The existing Osano [0] documentation finding is already reported and is not duplicated here.

gdpr: Option<bool>,
) -> (Option<String>, Option<Vec<i32>>) {
if gdpr == Some(true)
&& !matches!(ctx.jurisdiction, jurisdiction::Jurisdiction::UsState(_))

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.

🔧 [P1] Preserve US privacy signals when geolocation lacks a state

Jurisdiction::UsState represents membership in the configured privacy-state list, rather than all US traffic. Cloudflare's CloudflareGeo::lookup always supplies region: None, so its US requests become NonRegulated and miss this exemption.

I reproduced the consequence through production consent processing and request builders with real encoded cookies: standalone TCF grants Purpose 1, allowing the auction; GPP section 7 explicitly asserts sale opt-out; Standard and Prebid serialize only {"gdpr":1,"ext":{"gdpr":1}}, dropping both GPP fields. APS preserves them. This also reproduces with Prebid's openrtb_only mode, where no Cookie fallback exists. Restoring the previous forwarding behavior makes the same preservation assertion pass.

This regression removes the US opt-out signal needed downstream. Actual downstream enforcement was not exercised; the probe used native shared code with Cloudflare's actual geolocation shape and expiration checking disabled for its static fixture.

Proposed correction: retain country-level US provenance through the consent context and forwarding subsets, and use it for the US exemption while preserving the intended EU safeguard. Add coverage for US country-only geo and configured-state exclusions. Apply manually: this requires a coordinated change across files and cannot be expressed as a single inline suggestion.

Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
PR #1662's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in and #1646's fix that preserves filter headers through identity finalization. The merge is clean.
The new head of #1714 brings the US GPP opt-out fields work and, through its base chain, the rest of the identity stack, including the Sourcepoint consent capture from #1535.

crates/trusted-server-core/src/consent/gpp.rs: #1714 renamed the US decoder to decode_us_opt_out and widened it to sale, sharing, targeted-advertising, known-child and GPC refusals. #1722 limited TCF and US decoding to the sections the CMP says apply. The resolution keeps the #1714 decoder and its rules, adds the #1722 applicable_ids filter and GppApplicability match, and points the #1722 tests at the renamed us_opt_out field.

docs/guide/integrations/sourcepoint.md: #1535 replaced the section with the GPP API consent-capture guide. #1722 documented how __gpp_sid mirrors -1 and 0. The resolution keeps the #1535 guide, adds the #1722 __gpp_sid rules to it, and states the section ID range that /_ts/consent accepts.

Semantic fixes, so the chain applies one applicableSections rule. The IAB GPP CMP API reports [-1] when no section applies and 0 during stub or load. #1722 accepts -1..=65535, but the #1535 code, which merged clean, still rejected IDs below 1:
- sourcepoint/gpp_capture.ts and sourcepoint/index.ts accept -1 and 0 on the GPP API path and when seeding consent sync from the mirror.
- POST /_ts/consent (ec/consent_update.rs) and the snapshot validation in ec/app/route.rs accept -1..=65535. Their tests now accept [-1] and [0] and reject [-2].
- trusted-server-identity-providers joins and forwards the i32 section IDs that #1722 introduced.
The new head of #1622 brings the EC route consent script, which moves the GPP API capture to shared/gpp_capture.ts and adds the Prebid consent queue. #1722 merges it directly because it also builds on #1714, and the release candidate never carries a resolution of its own.

crates/trusted-server-js/lib/src/shared/gpp_capture.ts: #1622 moved the capture here and added the shared isApplicableGppSection check for 1..=65535. #1722 had widened the inline check to -1..=65535. The resolution keeps the #1622 helper, widens it to -1..=65535, and documents the -1 and 0 values.

crates/trusted-server-js/lib/src/integrations/sourcepoint/index.ts: #1622 switched the mirror writer to isApplicableGppSection, and #1722 used its local isValidGppSectionId. The resolution uses the shared helper throughout the module and drops the local copy, so one function holds the rule.

crates/trusted-server-js/lib/test/integrations/sourcepoint/gpp_cookie_bridge.test.ts: git paired the old Sourcepoint capture test with this new #1622 file. The resolution takes the #1622 file as is. The #1722 test changes move to test/shared/gpp_capture.test.ts, where #1622 put the capture tests.

Semantic fixes for the same applicableSections rule:
- test/shared/gpp_capture.test.ts: a ready [-1] reading is a decision that no section applies, not an unavailable read. [0] is accepted and [-2] is rejected.
- prebid/ec_route.ts comment and prebid consent_queue tests: the queue sends [-1] and [0], which the EC route accepts, and drops [-2].
@aram356
aram356 changed the base branch from main to fix/1695-us-gpp-opt-out-fields December 3, 2026 23:24
@aram356
aram356 changed the base branch from fix/1695-us-gpp-opt-out-fields to feat/1599-ec-route-consent-script December 3, 2026 23:25
aram356 added a commit that referenced this pull request Dec 3, 2026
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.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 17 identity realignment: rc/identity is now at 0ed862633, and EdgeZero stays pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 68dca95df to 070e2b075:

This PR now joins the identity chain. Its base is now feat/1599-ec-route-consent-script (#1622), and it also merges #1714's new head, which already contains #1535. #1622 moves the GPP capture to shared/gpp_capture.ts, and #1714 carries the consent decoder this PR changes. rc/identity takes both through this branch.

The two merges also apply this PR's applicableSections rule to the identity-chain code that #1686 lists. The rule follows the GPP CMP API: [-1] means the CMP determined that no section applies, and 0 appears while the CMP is a stub or still loading.

  • shared/gpp_capture.ts: isApplicableGppSection accepts -1..=65535, and a ready [-1] reading is a decision, not an unavailable read. Sourcepoint and the Prebid consent queue use this one check.
  • POST /_ts/consent (ec/consent_update.rs) and the EC route snapshot (ec/app/route.rs) accept -1..=65535. Their tests accept [-1] and [0] and reject [-2].
  • trusted-server-identity-providers joins and forwards the i32 section IDs.
  • consent/gpp.rs keeps Honor all decoded US GPP opt-outs #1714's decode_us_opt_out refusal rules and adds this PR's applicable-section filter.

Because of the #1714 merge, this PR's diff against #1622 also shows #1714's changes until that line merges. The SharedID _cst hash item from #1686 is still open.

Each merge message says what it carries and how any conflict was resolved.

Prebid.js hashes the GPP handler as [applicableSections, gppString] with
the CMP's list as reported. The `_cst` companion hashed the resolved
governing list instead, so `__gpp_sid=0` with a decodable header, or a
list mixing a sentinel with sections, produced a hash Prebid treats as a
consent change. Hash `applicable_sections` verbatim and keep the header's
sections only when `__gpp_sid` is absent. Expected values come from
Prebid.js 10.26's own cyrb53Hash.

Fixes #1735.
@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Added 80d1ee52f to this PR for #1735 (the SharedID _cst item, split out of #1686), so the follow-up the description mentions is now part of this PR.

Prebid.js hashes the GPP consent handler as [applicableSections, gppString], using the CMP's list exactly as reported. prebid_consent_hash hashed the resolved gpp_section_ids instead. So __gpp_sid=0 with a decodable __gpp, or a list like -1,7, produced a _cst that Prebid's userId module reads as a consent change. The hash now uses applicable_sections verbatim, and falls back to the header's sections only when __gpp_sid is absent.

  • The new test consent_hash_uses_the_cmps_applicable_sections builds the context from __gpp and __gpp_sid and covers 0, -1, -1,7, 7,2 and no __gpp_sid. Its expected values come from Prebid.js 10.26's own cyrb53Hash, the version this repo bundles. The same script reproduces the four existing vectors.
  • On the previous head the test fails: for [0] it got /lGVqw==, which is Prebid's hash for the header's section 2, where Prebid computes 8yh/FQ==. Removing the header fallback fails the no-__gpp_sid case.
  • At 80d1ee52f, run locally on macOS: fmt, the six adapter clippy aliases, test-fastly (4,493), test-fastly-reuse (269), test-axum (147), test-cloudflare (75), test-spin (93) and parity (42) all pass.

rc/identity takes this commit as plain merge 9ff0e494f, whose diff from 547991b80 has the same patch-id as 80d1ee52f. At that tree the core consent and SharedID tests (196) pass.

@aram356 aram356 linked an issue Dec 4, 2026 that may be closed by this pull request
1 task
@prk-Jr prk-Jr mentioned this pull request Dec 4, 2026
12 of 14 tasks
@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as b0745b200, on top of 80d1ee52f.

Trusted Server owns the /_ts/ namespace (#1740). A request for /_ts or any /_ts/ path that no route handles now gets a local 404 on Fastly, Axum, Cloudflare and Spin, and never reaches the publisher origin. The path is matched after percent-decoding. Paths outside the namespace, such as /_tsx or /articles/_ts/x, still go to the publisher origin, and every routed /_ts/ path answers as before.

This merge takes #1622's new head (0d5de86d3), which carries 48930c270 and nothing else new to this branch. It was clean.

Checks on this head: no conflict markers; cargo fmt --all -- --check passes; the merge adds exactly #1614's change to this branch's files; it merges cleanly with every lower head in its stack; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. rc/identity (e72407155) passed the full CI gate list with the change.

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

4 participants