Repository navigation
Conversation
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed d9f93a055 against main (ab5c24f73).
Approving so I'm not the one holding this up, on the understanding that you'll work through the inline comments before merging. No behavioral problems found. The fix matches #1694, and all four withheld cases have tests that pass. The comments are maintenance and style.
Things to be aware of, not blocking:
- A missing record now returns
403 {"consent":"denied"}. If a fresh row is briefly invisible aftercreate_if_absent(cross-POP KV consistency), a consenting reader gets a consent-denied answer instead of the old 200. The issue asks for this behavior; I just couldn't tell how often the race happens. - A Purpose-4 refusal without an EC cookie now gets
403instead of204, because the consent gate runs before theec_valuecheck. That matches pull sync and finalize.
Checks: cargo test -p trusted-server-core --lib ec::identify::tests (18 passed), rustfmt and prettier on the changed files. I didn't run Viceroy or the integration suite.
| // Do not extract IDs or evaluate cluster size because that would | ||
| // write back with the live-entry TTL. | ||
| log::trace!("Identify found tombstone for '{}'", log_id(ec_id)); | ||
| return json_response_with_origin( |
There was a problem hiding this comment.
R1 · Nonblocking: the consent-denied 403 is now built in three places. This branch and the Ok(None) branch below repeat the json_response_with_origin(StatusCode::FORBIDDEN, &json!({ "consent": "denied" }), ...) call from the consent gate at the top. A small consent_denied(allowed_origin) helper would keep the three in step if the denial shape or headers change. It pairs well with R4.
| ec: ec_id.to_owned(), | ||
| consent: "ok".to_owned(), | ||
| degraded, | ||
| degraded: false, |
There was a problem hiding this comment.
R2 · Nonblocking: degraded is now always false, and the docs no longer say so. Every path that used to set it now returns 503, and the doc sentence that explained the field was removed. The API reference example still shows "degraded": false with no explanation. One line in docs/guide/api-reference.md would cover it: "degraded is kept for compatibility and is always false; KV read failures return 503." Removing the field would be cleaner but breaks the wire contract.
| }; | ||
|
|
||
| if !ec_consent_granted(ec_context.consent()) { | ||
| // TODO(#1684): Also enforce the authenticated partner's TCF vendor consent. |
There was a problem hiding this comment.
R3 · Nonblocking: the "may disclose EC to a partner" rule now has two copies. This gate is the same as pull sync's (pull_sync.rs:74-75, where ec_allowed() is ec_consent_granted). #1684 will extend both with a partner vendor check, and only this copy has the TODO(#1684). Either add one predicate in ec/consent.rs (for example ec_disclosure_allowed) used by both, or at least put a matching TODO next to the pull-sync gate so #1684 doesn't miss it.
| @@ -94,6 +95,11 @@ pub fn handle_identify( | |||
| // Do not extract IDs or evaluate cluster size because that would | |||
There was a problem hiding this comment.
R4 · Nit: leftover else and mutable accumulators. Now that every non-live arm returns, the if !entry.consent.ok { ...; return } else { ... } nesting and the let mut uid = None / cluster_size setup are leftovers from when those arms fell through to the 200. Binding the live entry with a match that returns early on tombstone, missing and error lets uid and cluster_size be plain lets, matching the let ... else guards earlier in the function.
Summary
403 {"consent":"denied"}for tombstoned or missing records and503 {"error":"kv_unavailable"}for failed reads, without identity fields. Preserve the allowed response shape and no-active-EC204.db36dc0ec. The bug and both helpers already exist there. Vendor-ID enforcement remains deferred to Add a TCF vendor ID to EC partners and enforce it #1684, with a TODO at the consent gate.Changes
crates/trusted-server-core/src/ec/identify.rsdocs/guide/api-reference.mddocs/guide/ec-setup-guide.mddocs/guide/fastly.mddocs/superpowers/specs/2026-03-24-ssc-prd-design.mddocs/superpowers/specs/2026-03-24-ssc-technical-spec-design.mdFastly forwards the shared handler's responses unchanged. On main, Axum, Cloudflare, and Spin do not wire identify. Existing integration successes use live records and allowed US consent; no-cookie
204and GPC-denied403expectations remain valid. Parity has no identify-specific assertions. The core unit test expecting KV-error200/degraded success is replaced.Closes
Closes #1694
Spec
Not a feature; this corrects the existing identify consent rule.
Test plan
CI runs the full checks. No local checks were rerun for publication; the installed domain-lint commit hook was skipped for this invocation under that instruction.
Previously completed evidence, before the final exact-503-payload assertion was added:
200; the full-consent control passed.cargo test -p trusted-server-core --lib ec::identify::tests --locked: 18 passed after the production fix.cargo clippy -p trusted-server-core --all-targets --all-features --locked -- -D warnings: passed.ec/uid/eid, preserve the complete full-consent payload, and check that tombstones remain unchanged. The final additional assertion checks the exact documented503error body; its execution is delegated to CI.Rust 1.98.1 and Node 24.20.0 were used. No Viceroy execution is claimed: the installed 0.17.0 differs from the repository's 0.22.0 pin.
Trial merge into rc/identity
An actual
git merge --no-commit --no-ffof875d78d1bintoorigin/rc/identityatc3e336666found four conflict regions, all in coreec/identify.rs: response variables, imports, and the rewritten async tests. All five Markdown files merged cleanly. The disposable merge was aborted; no merge commit was created or pushed.Local review and runtime evidence
The prepublication independent local review found zero blocking code findings. Its one optional suggestion—asserting the exact
503JSON body—is included in this commit. This is code-review evidence, not a CI or runtime guarantee.Main has no Axum identify route. Runtime verification therefore used existing real Axum routing and durable local records from
rc/identityatc3e336666, with only the production fix ported into a disposable checkout. The port preserved rc's async/provider behavior and is not part of this main-based patch.Built the actual Axum binary with
--features geo-cloudfront, then used curl against localhost with fictional config, synthetic TCF, protected synthetic DE geography, and local records:200withec,consent:ok,degraded:false, source domain, and cluster size403 {"consent":"denied"}, no EC403 {"consent":"denied"}, no EC; admin diagnostic independently confirmedtombstone:trueandconsent.ok:false403, no EC401/200; no-store and reflected CORS checkedThe local EC POST used its matching HTTP Origin. Runtime binary SHA-256:
8f9ade08fc017ba6f5a6f7ec56539271519f0786b2b643bdda0276deb36f9ae3. The owned server stopped normally and the scratch worktree was removed. This proves the port through rc's real Axum startup/storage, not Axum availability on main or Fastly runtime behavior. No browser, external partner, staging/production proxy, or deployment was used.Checklist
875d78d1b).