Repository navigation
Conversation
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed 83e447d05 against main (db36dc0ec).
Approving so I'm not blocking, on the understanding that you'll handle the comments before merging. The field mapping checks out against iab_gpp 0.1.2 for every supported section, including the three without GPC (VA, UT, FL).
R1 · Nonblocking: please add a CHANGELOG entry. Out of the diff, so here instead of inline. Operators will see this: US-state readers whose GPP refuses sharing, targeted ads or known-child consent, or sets GPC, stop getting a new EC, and a held EC is expired on the next request. Recent user-visible fixes (#1516, #1493, #1429) added a ### Fixed bullet under [Unreleased]. One referencing #1695 would do.
Question, not blocking: Prebid's MSPA activity controls deny more cases than this does (for example any applicable under-13 value, including 2, and PersonalDataConsents == 2). This follows #1695's narrower rule. Do we want Prebid parity later?
Reminder, as you noted: ec/consent_update.rs:480 on rc/identity still reads us_sale_opt_out, so RC tests won't compile until that's renamed.
Checks: cargo test -p trusted-server-core --lib consent:: (125 passed), native clippy on core, rustfmt.
| } | ||
| // Personal consent granted; MSPA covered, option and provider modes = no. | ||
| if personal { | ||
| bits.push_str("10"); |
There was a problem hiding this comment.
R2 · Nonblocking: this repeats the bits-to-base64url packing from encode_header. Both helpers pad to 6 bits, chunk, and map through the same URL-safe alphabet (encode_header around line 555). A shared test-only bits_to_base64url keeps the two fixture encoders from drifting apart.
| _ => 3, | ||
| }; | ||
| let personal = matches!(section_id, 7 | 8 | 13..=17 | 19..=23); | ||
| let gpc = !matches!(section_id, 9 | 11 | 13); |
There was a problem hiding this comment.
R3 · Nonblocking: which sections lack a GPC field is written twice. !matches!(section_id, 9 | 11 | 13) appears here and again in each_state_refusal_blocks_minting_and_withdraws_ec (line 885). A us_test_has_gpc(section_id) next to us_test_opt_out_fields would keep the fixture and the expected fields in agreement.
| "should allow minting without withdrawal for section {section_id}" | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
R4 · Nit: missing blank line before this #[test]. Every other test in the module has one, and rustfmt won't add it.
Summary
GppConsent.us_opt_outand use it for both EC creation and explicit withdrawal, preserving the API shape for downstream work.Changes
crates/trusted-server-core/src/consent/gpp.rscrates/trusted-server-core/src/consent/types.rscrates/trusted-server-core/src/consent/mod.rsdocs/guide/integrations/prebid.mdBase:
main(db36dc0ecad8c3041bc443fb6487aeae162e3ed3). The GPP decoder is identical onmainandrc/identity, and both EC policy functions exist on both. This fix can land independently of the identity integration branch. PR target:main.A GPP string that refused sharing, targeted advertising, known-child consent, or GPC while leaving sale permitted previously allowed new EC creation and did not count as an EC withdrawal. Rename
GppConsent.us_sale_opt_outtous_opt_outand aggregate each supported explicit refusal. Both EC decisions consumectx.gpp.as_ref().and_then(|gpp| gpp.us_opt_out); preserve the optional shape for downstream consumers.All opt-out fields below are under
coreand trigger only onOptOut::OptedOut(1). Child leaves are undercore.known_child_sensitive_data_consentsand trigger only onConsent::NoConsent(1); where marked scalar, that field itself is the consent value. GPC triggers only when section-levelgpc == Some(true).sale_opt_out,sharing_opt_out,targeted_advertising_opt_outfrom_13_to_16,under_13sale_opt_out,sharing_opt_out,targeted_advertising_opt_outprocess_sensitive_data_from_13_to_16,process_sensitive_data_under_13,process_personal_data_from_16_to_17sale_opt_out,sharing_opt_outsell_personal_information,share_personal_informationsale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)sale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)sale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)sale_opt_out,targeted_advertising_opt_outprocess_sensitive_data_from_known_child,sell_personal_data_from_13_to_16,process_personal_data_from_13_to_16sale_opt_out,targeted_advertising_opt_outunder_13,from_13_to_16,from_16_to_18sale_opt_out,targeted_advertising_opt_outprocess_sensitive_data_from_known_child,sell_personal_data_from_13_to_16,process_personal_data_from_13_to_16sale_opt_out,targeted_advertising_opt_outprocess_sensitive_data_from_known_child,sell_personal_data_from_13_to_16,process_personal_data_from_13_to_16sale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)sale_opt_out,targeted_advertising_opt_outprocess_sensitive_data_from_known_child,sell_personal_data_from_13_to_16,process_personal_data_from_13_to_16,sell_personal_data_from_16_to_18,process_personal_data_from_16_to_18sale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)sale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)sale_opt_out,targeted_advertising_opt_outprocess_sensitive_data_from_known_child,sell_personal_data_from_13_to_16,process_personal_data_from_13_to_16sale_opt_out,targeted_advertising_opt_outprocess_sensitive_data_from_known_child,sell_personal_data_from_13_to_16,process_personal_data_from_13_to_16,sell_personal_data_from_16_to_17,process_personal_data_from_16_to_17sale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)sale_opt_out,targeted_advertising_opt_outknown_child_sensitive_data_consents (scalar)Not Applicable scope: the aggregation helpers are changed, but value 0 remains a non-refusal, as does invalid 3 after the dependency maps it to NotApplicable. Tests explicitly preserve this behavior. #1698 remains separate. No changes to general sensitive-data fields, personal/additional consent, notices, MSPA modes, jurisdiction policy (#1708), legacy US Privacy forwarding/grants (#1697), or EdgeZero.
Former-reader inventory:
consent/gpp.rs: decoder construction, per-section aggregation and decoder assertions now useus_opt_out.consent/types.rs: publicGppConsentdeclaration and field documentation now describe the broader signal. It remains nested inConsentContext.gpp; there is no second flag.consent/mod.rs::allows_ec_creation: both the refusal-priority check and the decoded non-refusal branch readus_opt_out; US opt-outs still take precedence over TCF grants.consent/mod.rs::has_explicit_ec_withdrawal: readsus_opt_outto classify explicit withdrawals.consent/mod.rsfixture constructors/assertions: renamed without changing unrelated policy.auction/endpoints.rs) and publisher/page-bids paths consume the broader flag indirectly throughEcContext::ec_allowed()and EC eligibility. Existing gates withhold the EC ID and body/cookie EIDs when EC consent is denied, so the new refusals now also reach those gates without adding duplicate field checks. KV partner resolution likewise requires the eligible EC.integrations/prebid.rsreceives the centrally filtered auction request and needs no direct field read.gate_eids_by_consentandallows_eid_persistenceretain the additional TCF/GDPR checks; auction eligibility itself can still allow an auction without identity.log_consent_contextandlog_consent_signals) and admin have no explicit old-field reader. Derived Debug output naturally uses the new field name.docs/guide/integrations/prebid.md: describe the broadened US refusals and the EC eligibility gate before the separate TCF/GDPR EID filter. The existing degraded-behavior table remains accurate once the missing refusal fields are recognized.docs/superpowers/plans/2026-04-15-sourcepoint-gpp-consent.mdanddocs/superpowers/specs/2026-04-15-sourcepoint-gpp-consent-design.md: retain the old name as historical design/implementation records, rather than presenting them as current API documentation.ec/consent_update.rs:480: a test assertion still reads the old name. It is absent on main; see trial-integration note below.Closes
Closes #1695
Spec
Not a feature; scoped consent-decoding bug fix.
Test plan
The following targeted checks ran before publication approval on the reviewed source. No gates were rerun for publication; the full CI matrix is delegated to GitHub Actions as requested.
Targeted core consent tests, EC finalization tests and the independently exercised forwarding regression.
Core clippy with all targets/features and warnings denied.
Changed-file Rust/Markdown formatting checks.
Independent local review and actual Axum runtime verification on the scratch RC integration, scoped below.
Full CI matrix: GitHub Actions. Current-revision hosted checks complete.
Baseline
cargo test --locked -p trusted-server-core --lib consent::: 118 passed.Fail-first generated National v2 tests observed
(minting=true, withdrawal=false)for sharing, targeted advertising, all three known-child leaves and GPC; California sharing-only failed the same way. Sale-only and all-permission controls already passed.Final
cargo test --locked -p trusted-server-core --lib consent::: 125 passed. Generated fixtures cover National v1/v2 and every state opt-out/child/GPC field individually, and prove the selected named field appears in the dependency's decoded result. No-refusal control covers all state sections; multi-section precedence, absent/malformed sections and values 0/3 are covered. A previous Virginia "non-opt-out" fixture actually denied child consent; replace it with a generated all-permission fixture.cargo test --locked -p trusted-server-core --lib ec::finalize::tests::: 41 passed.cargo clippy --locked -p trusted-server-core --all-targets --all-features -- -D warnings: passed.Changed-file rustfmt check, Prebid Markdown Prettier check, and
git diff --check: passed.Rust 1.98.1, Node 24.20.0. No full CI suite run, per requested scope. Cargo reports a preexisting future-incompatibility warning in proc-macro-error2 2.0.1.
Trial integration:
rc/identityatc3e33666604d5d3b6e043fc206931b3681c8f3bf.origin/mainis its merge base and ancestor. Applied the complete main-based patch withgit apply --3way, which performs the same three-way file integration without creating a commit.ec/consent_update.rs:480before running RC tests. It is test-only and does not participate in the runtime binary. No RC source edits were made beyond the exact candidate patch.2f6ba73c4844543052ccbe6b0b87053594df3cc15f27e6b9ee02390b9472ad0a.Independent local review: READY TO REQUEST REVIEW for the main-based code change. One documentation finding was corrected: the guide must describe the earlier EC eligibility gate rather than imply browser EIDs bypass US refusals. The bounded recheck closed it; zero open blocking or optional findings. The reviewer independently ran the existing
auction_strips_client_eids_when_ec_identity_deniedcore test (1 passed), confirming the common upstream gate. Final reviewed patch SHA256:2f6ba73c4844543052ccbe6b0b87053594df3cc15f27e6b9ee02390b9472ad0a.Runtime verification: VERIFIED on the real Axum binary from the scratch RC integration. Stock main Axum lacks the necessary geo/EC lifecycle wiring, so this is RC-integration runtime evidence, not a main-only Axum certification. No runtime or EdgeZero changes were added to main to manufacture that evidence.
trusted-server-axumbinary withcargo build --locked -p trusted-server-adapter-axum --features geo-cloudfront, Rust 1.98.1, Node 24.20.0, dev debug info disabled. No wrapper or test-only EC lifecycle wiring.publisher.example.comconfiguration through the supported local config-store envelope, fake secret references, protected loopback CloudFront US/CA metadata and local persistent records. Actual response headers confirmedx-geo-country: US,x-geo-region: CA; all five requests returned 200 and the local-origin sentinel.DBABBg~BVqqqqpo: sale=2, sharing=2, all sensitive fields=2, both known-child consents=2, personal consent=2, GPC absent.DBABBg~BVmqqqpochanges only sharing to 1. MSPA covered=1, option/provider modes=2 in both.ts-ecwithMax-Age=31536000.Set-Cookieand did not mint an EC.Set-Cookie: ts-ec=; Domain=.publisher.example.com; Path=/; Secure; SameSite=Lax; Max-Age=0; HttpOnly.c3e33666604d5d3b6e043fc206931b3681c8f3bf; exact RC-integrated patch SHA2565797ae93260998a65168854a2dc19d75fc6d54cb1d08ea5b1193566549669b1a. Tested binary SHA256c76fe8bf82b882ea5f51087f0085162cb78dbd799e62ee6a56297844256e625f. The tested GPP decoder exactly matches the main-based candidate.example.com; switching to fictionalpublisher.example.comresolved the setup error without changing code or relaxing validation. This failed setup is not counted as an application regression.Checklist
unwrap()introduced in production code.println!or additional logger introduced.