Repository navigation
Conversation
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed c1c948d47 against main (db36dc0ec).
Approving so I'm not blocking, on the understanding that you'll handle the comments before merging. Behavior matches #1705, and the Fastly, Axum and Cloudflare country-only tests all pass.
Question: the fallback applies even when consent.us_states.privacy_states = []. A resolved US reader is then non-regulated while an unresolved one is strict, and on Cloudflare, which never sets a region, all US traffic gets gated despite no configured states. Is that intended, or should the fallback require at least one configured state? No test covers the empty list.
Worth noting in the PR description: the log label changes from non-regulated to US for this traffic, and on Cloudflare this affects all US requests, including existing ECs no longer being forwarded without a signal.
Checks: core consent and OpenRTB consent-matrix tests (122 passed), country_only_us tests for Axum, Cloudflare and Fastly (Viceroy 0.22.0), cargo fmt --check.
|
|
||
| // A resolved US country still requires US consent when its state is | ||
| // missing or unreadable; losing state detail must not remove the gate. | ||
| return Jurisdiction::UsState("US".to_owned()); |
There was a problem hiding this comment.
R1 · Nonblocking: name the "unresolved US state" sentinel once. Reusing UsState is the right call, since it makes every existing match apply the strict rules. But the literal "US" is now relied on here, in the Display guard, and in 13 test sites across core, OpenRTB and three adapters. A future consumer that reads the payload as a state code (say, per-state GPP section selection) has to know the convention, and nothing enforces it. A Jurisdiction::UNRESOLVED_US_STATE constant or a Jurisdiction::us_unresolved() constructor used everywhere would keep the shape and drop the scattered literal.
| - **Unknown**: Fail-closed when jurisdiction cannot be determined. | ||
|
|
||
| A request whose country is `US` but whose region is missing or unreadable uses | ||
| `UsState("US")`: the same strict US consent rules, without inferring a state. |
There was a problem hiding this comment.
R2 · Nit: describe the label operators see, not the Rust value. These guides use policy labels elsewhere ("US State", "Non-regulated"). Operators will see jurisdiction=US in logs, not UsState("US"). Something like "the US (state unresolved) policy, logged as jurisdiction=US" would fit. Same in docs/guide/gdpr-compliance.md:123.
| Resolution of conflicting signals is configurable (restrictive, | ||
| newest, or permissive). | ||
| - A request with country `US` and a missing or unreadable region uses the | ||
| strict US rules (`UsState("US")`). Without a consent signal, no new EC is |
There was a problem hiding this comment.
Same wording note as in edge-cookies.md (R2).
Summary
USin logs.Base/target:
main(db36dc0e), where the shared detector lives.rc/identityis runtime/integration qualification only: its newer identity lifecycle is outside this fix. #1708's general refusal/all-states changes, adapter production changes and EdgeZero changes are excluded.Changes
crates/trusted-server-core/src/consent/jurisdiction.rscrates/trusted-server-core/src/consent/mod.rscrates/trusted-server-core/src/auction/openrtb/tests.rscrates/trusted-server-adapter-axum/src/app.rscrates/trusted-server-adapter-cloudflare/src/app.rscrates/trusted-server-adapter-fastly/src/app.rsdocs/guide/edge-cookies.mddocs/guide/gdpr-compliance.mdCloses
Closes #1705
Spec
Not a feature: focused bug fix. No new configuration or provider behavior.
Adapter behavior
NonRegulated, allowing signal-free EC generation.cf-ipcountry: USsupplies no region and selectsNonRegulated.Unknown; injected country-only US selectsNonRegulated.Unknown. With supplied US geo, actual adapter context construction selects strict US policy. Main's publisher lifecycle still cannot mint/finalize an EC cookie, including with a valid grant.NullGeosupplies neither country nor region, retainingUnknown.Consumers checked
allows_ec_creation: matches the US variant, ignores payload; no signal denies, valid US GPP grant permits, explicit opt-outs deny.has_explicit_ec_withdrawal: matches the variant; absence denies creation without asserting withdrawal.build_regs: standard/Prebid omit empty regs; US signals remain non-GDPR unless an actual EU signal applies. APS uses the applicability bit. The pseudo-state is never serialized.US, preserving labels such asUS-CA.privacy_statesmembership test; none downstream. GPP decoding aggregates US sections independently of geographic state.rc/identity, proxy EC disclosure delegates to the existing EC permission gate, so the fallback also tightens disclosure there.Test plan
Hosted PR CI is green for
c1c948d476(merge1ac9304againstdb36dc0e): all 30 reported checks passed, including adapter tests, target-matched lint, docs/JS and integration/runtime suites. Local checks and scratch-RC runtime evidence below are separate. Live mainab5c24f73merges cleanly; those runs did not execute that newer pairing.Fail-first evidence: missing/unreadable US-region and logging assertions fail on the base; all three adapter regressions fail at
NonRegulatedversusUsState("US")before the correction.Passing focused checks with Rust 1.98.1, Node 24.20.0 and Viceroy 0.22.0:
__gpp=DBABLA~BVQqAAAAAgA.QAgrant control. These are adapter-context/generation tests, not end-to-end cookie-finalization claims.--all-targets --all-features), Cloudflare native clippy (--all-targets), core + Fastly WASI clippy (--all-targets --all-features), and Cloudflare Worker WASM library clippy (--features cloudflare): passed with-D warnings.Representative test commands:
The full CI suite was intentionally not run locally; the hosted results above cover the reviewed revision.
rc/identity trial integration
A literal
git merge --no-commit --no-ffof signed commitc1c948d476ac1cc76bceb1f997e32cc50b5078e1intorc/identityatc3e33666, in a disposable scratch worktree, found conflicts in:crates/trusted-server-adapter-axum/src/app.rscrates/trusted-server-adapter-cloudflare/src/app.rscrates/trusted-server-core/src/consent/jurisdiction.rscrates/trusted-server-core/src/consent/mod.rsdocs/guide/edge-cookies.mdAxum/Cloudflare test-module insertions overlap RC startup tests; jurisdiction comments and its old no-region expectation overlap; consent-test imports overlap; the EC guide overlaps RC storage wording. Fastly tests, the OpenRTB matrix and GDPR guide applied textually cleanly. Integration also needs RC's newer
GeoInfofixture shape and adjustments to existing RC country-only/unreadable-region policy assertions and conformance expectations. Preserve the RC identity/storage flow and #1708's independent scope.The literal merge confirmed the earlier uncommitted-patch preview: the same five conflicted files, with no new conflicts. The trial merge was aborted and the clean scratch worktree removed after preserving conflict evidence. No RC merge commit or RC push was made.
Independent review and runtime evidence
Independent local review found zero blocking code findings and zero optional findings. After runtime qualification confirmed that the reviewed source was unchanged, its readiness label is READY TO REQUEST REVIEW for the scoped main policy fix. That label does not certify main Axum's missing identity lifecycle or a combined RC deployment.
Main Axum HTTP routing with injected US/no-region geo returned the article and no EC cookie for both no signal and a valid GPP grant. The positive cookie control failed because main does not run publisher EC generation/finalization. This preexisting limitation remains unchanged and is not hidden by the supplementary result.
Supplementary runtime verdict: VERIFIED on scratch RC integration. Only the exact reviewed production detector/display code was overlaid into
rc/identityatc3e33666; RC tests/docs were not backported for the runtime build. The actual Axum executable ran through its managed startup, local prepared config/secrets, persistent record binding, and existing protected loopback CloudFront geo provider, with synthetic assertions and a controlled HTTP origin. No manual generation/finalization was added.Both matrices passed all seven expectations. The required country-only requests exposed
x-geo-country: US, no region header, and the controlled publisher article with HTTP 200. The positive cookie was__gpp=DBABLA~BVQqAAAAAgA.QA. Every minted EC was confirmed through the authenticated admin lookup: HTTP 200,consent.ok=true,tombstone=false.The invalid-region CloudFront control is rejected by the pinned SDK before reaching the detector, withholding all geography. It proves unchanged fail-closed behavior, not the core unreadable-region fallback. Core fail-first tests cover the latter. No EdgeZero change is included.
The RC runtime qualifies local application routing, managed provider handoff, persistence and finalization with synthetic inputs. It does not qualify real CloudFront/ALB protection, a deployed environment, other adapter runtimes, or main's EC cookie lifecycle. Both owned servers stopped. No browser, DataDome access, staging/production proxy or deployment was used.
Checklist
Feature spec review: not applicable to this bug fix.
unwrap()introduced.logmacros; no production logger installed.