Repository navigation
Conversation
|
For #1532's rename of the native Geo profile variable to No file in this PR uses the old name after the merge, so it only takes the rename from #1646. The merge had no conflicts. Correction: through #1566, this merge also carries five #1540 commits that #1566 had not merged before (CloudFront forwarding authentication, AWS ingress and Terraform demo prerequisites, the example deployment gate and the deployment guide). It is not only the rename. |
Take #1646's WB-1 lifecycle wording in the edge-cookie guide and keep the sliding-renewal sentences. Port the Fastly sliding test to page lookups on the EC context. Model admitted clients in the sliding tests now that refused clients get no navigation permit, and add a refused-client case. Update the spec's base reference and add its review log.
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids from the Prebid config into the auction EIDs, and a99dd66, a62601b, d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30 days from the UTC day start and pass the request time into finalize. They arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623, #1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646, with #1646's move of the request time into IdentityApp::finalize. It also brings d5276ee, which publishes the native AWS runtime files without GNU mv -T, and Christian's merge 5597d3e of #1538 into #1540, through #1566's merge. The base now also carries the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which decodes the Spin discovery document with Response::json, and #1627's merge of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI. The merge also brings the 12 #1646 commits this PR lacked, from 48a43ae to 461aa0d: dhruv8sh's page-phase lookup and /auction EID work (48a43ae, 82fe088, 1d0a74f, 838586e and his chain merges a061c01, ecf16e8, e1d23a0, edcf4c5 and 9a020e1), the merge 9cad928 of #1641 into #1642, and prk-Jr's "Merge providers-awaited into shared identity" (4ffbaf8) and "Restore Fastly auction browser gating" (461aa0d). Edge cookies guide: a conflict is the request lifecycle paragraph. The merge takes #1646's sentences on positive identity cookies, core expiries and /auction body EIDs, and keeps this PR's closing sentences on the default ec.sliding_refresh = false flow and sliding renewal. Fastly adapter tests: 82fe088 from #1646 removed the navigation-lookups thread-local and the page-lookups argument of apply_edgezero_ec_finalize, since the handler now collects page lookups onto the EC context. This PR's sliding_ec_renews_held_publisher_identity_before_terminal_privacy test drops its two take_navigation_lookups calls and passes no page lookups to finalize. Its configuration has no record store or providers, so no lookups were collected before either, and its assertions are unchanged. It also brings b2d4bfd from #1488, which records the known UID hashes on lookup results with a setter, so the provider IDs the write planner logs are not derived from them. The base now also carries #1506's repin of EdgeZero to rc/identity at d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. This PR now stacks on #1661 instead of #1646, so rc/identity can take both as plain merges. #1661 sits on #1656 and #1626, which sit on #1646, so the merge also brings #1626 (provider opt-outs and legacy EID expiry on Fastly and Axum), #1656 (the configurable Edge Cookie browser gate) and #1661 (refusing EC creation when a trusted JA4 contradicts the User-Agent). Cloudflare route tests: both PRs add a test at the end of the file. The merge keeps both, this PR's sliding_ec_configuration_preserves_unsupported_platform_responses and #1661's ec_route_creates_no_record_whatever_the_bot_management_ja4. Fastly sliding EC test: #1617, which now sits below this PR, answers GET /health through the router's probe hook as an operational response, which carries no EC state. This PR's sliding_ec_renews_held_publisher_identity_before_terminal_privacy routes /health through the router and expected EC state on every path but the unsupported EC route, so it now also accepts the liveness probe without EC state. Its check that /health issues no renewal cookie is unchanged. The base now also carries #1627's 4d0c1a2, which renames the generic runtime KV store to trusted_server_runtime_kv, #1488's a610152 and 9104fd3, which add hashed-email intake for the LiveRamp and ID5 identity providers, #1646's aa31559, which gates identity writes for rejected clients, and #1626's d07f789, which withholds a mirrored UID while another source owner is opted out. Settings: this PR's MaxAgeDays and #1488's HashedEmailSource are both added before Ec in settings.rs; the merge keeps both. This PR's head moves to fbe5670, its merge of #1646's aa31559, which models admitted clients in the core sliding tests, finalizes them with the store gate and adds refused_client_gets_no_renewal_or_record_io, and adds the proposal's review log. Taken as the change from the old head 668d501, the new head would replay #1646 commits the base already carries in rebuilt form. The merge takes only fbe5670's own resolution, the change from a plain merge of 668d501 and aa31559 to fbe5670: the sliding tests and the proposal apply cleanly, and its Fastly sliding test port is the one this merge already made.
|
For the identity integration branch (#1608), I pushed
I changed the base to |
|
For the identity integration branch (#1608), I pushed |
|
For the identity integration branch (#1608), I pushed |
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
This PR adds two EC settings. ec.max_age_days is a checked type (MaxAgeDays, 1–400 days, default 365) that sets the lifetime of every new ts-ec cookie. ec.sliding_refresh is off by default. When on, it re-sends the same ts-ec value with a full lifetime on eligible publisher pages on Fastly and Axum. I found no bugs I could confirm. Two known limitations are documented rather than fixed, and both are acceptable for a proposal. There is also a process gate the PR sets for itself before merge.
Cross-cutting / body-level findings
- 🤔 Out-of-band revocation still renews until the record is read: if a record is revoked out of band but isn't read on the current request, its
ts-eccookie is still renewed. This keeps happening until a later request reads the record. The PR documents this limitation, which is acceptable for a proposal. - 🤔 An origin
Set-Cookie: ts-eccan produce a secondts-echeader: on an eligible page, an originSet-Cookie: ts-eccan pass through. The response may then carry twots-echeaders. The PR documents this limitation, which is acceptable for a proposal. - 📝 Merge is gated on DEC-13 and #1595: the PR's own docs say not to merge until DEC-13 is formally recorded and #1595's rule against
Set-Cookiefor returning readers is updated. This is a process gate, not a code defect. - 📝 Consent and record-state gating checked: renewal only happens after the existing consent check in
finalize_response_inner, which returns early when consent does not allow the EC. Renewal also needs two things: the page-load write succeeded, and the stored record is unread or live. A known missing, revoked or failed record stops it. Renewal is skipped when the EC was just created, and when the incoming cookie is not the active EC or is invalid. - 📝 Response eligibility checked: a flag set in the lifecycle code limits renewal to publisher documents that are not EC API calls. The new tests cover the method, status and asset cases, refused clients, rotation and withdrawal.
- 📝 Mirror cookie decoupled: the mirror cookie now has its own one-year constant, so changing the EC lifetime doesn't affect it.
- 📝 Defaults don't serialize: when neither setting is given, both are left out of the serialized config.
- 📝 Cloudflare and Spin unaffected: tests show both adapters return identical responses whether the setting is absent, off or on.
CI Status
- integration tests: PASS
- integration tests (Fastly EC lifecycle): PASS
- ts dev lint domains (changed lines): PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- trace runtime and browser acceptance: PASS
- browser integration tests: PASS
- cargo test (cross-adapter parity): PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- vitest: PASS
- Fastly response diff script: PASS
- cargo test (axum native): PASS
- format-docs: PASS
- release scripts: PASS
- Native provider acceptance script: PASS
- cargo test: PASS
- CI Node pin guard: PASS
- cargo fmt: PASS
- health-startup (axum): PASS
- prepare integration artifacts: PASS
- worker-deadlines (spin): PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- format-typescript: PASS
- docs-proposal scripts: PASS
- HTML EOF runtime (Fastly): PASS
- CLAUDE.md symlink guard: PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- record-provider-image: PASS
- worker-deadlines (cloudflare): PASS
- health-startup (fastly): PASS
- health-startup (cloudflare): PASS
- stock-celld-records: PASS
- health-startup (spin): PASS
- local-provider-image: PASS
|
For the identity integration branch (#1608), I pushed Takes #1661's new head 5d951a7, which carries #1506's repin of EdgeZero to rc/identity at 1619078a (8edc50e), a revert that removes IABTechLab/edgezero#522 (portable Fastly record providers) and IABTechLab/edgezero#524 (outbound mTLS client identities). The merge is clean. |
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed 8560f8e3a06b against its live base, #1661 at 5d951a783ec1. I am requesting changes because the opt-in renewal can add an EC cookie to a response whose origin cache policy still permits shared storage. The inline comments separate correctness defects from non-blocking cleanup. The existing hosted renewal tests passed, but they do not exercise the field-qualified cache policy.
This review is separate from the policy decision. DEC-13 remains open, and #1595’s WB-2/WB-5 acceptance wording still needs to be updated before merge.
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Re-review of 8560f8e3a..6398e976d (one commit).
12 of 13 items from my last review are addressed. R8 (sharing the Cloudflare/Spin test matrix) is deferred, which is fine since it was nonblocking. The fix for prior R1 opened a new privacy gap in the operator-header guard; that's R1 inline and the one I'd want fixed first.
Approving so I'm not blocking, on the understanding that you'll handle the inline comments before merging. DEC-13 and the WB gates still apply as merge conditions for the proposal itself.
| @@ -64,7 +65,7 @@ fn cache_control_is_private_or_no_store(response: &Response) -> bool { | |||
|
|
|||
| /// Returns whether `Cache-Control` prohibits storage by shared caches. | |||
| pub(crate) fn cache_control_forbids_shared_storage(headers: &HeaderMap) -> bool { | |||
There was a problem hiding this comment.
R1 · P2 (privacy): operator Cache-Control can now replace an origin's field-qualified private. Switching this wrapper to the strict whole-response matcher fixes the cookie downgrade, but the same wrapper also decides response_is_uncacheable in apply_response_headers_with_cache_privacy (lines 207, 214-218), which stops operator Cache-Control and edge-cache headers from weakening a private response. Take a cookieless origin response with Cache-Control: max-age=600, private="X-Reader-Hint". Before this delta, operator cache headers were skipped. Now an operator cache-control = "public, max-age=3600" replaces it and an operator surrogate-control survives, so the per-reader field becomes shared-cacheable. A scratch test confirms it: at 8560f8e3a the origin policy is kept and surrogate-control is None; at 6398e976d the result is public, max-age=3600 with surrogate-control: max-age=3600. All four adapters call this, with renewal on or off.
Use the strict matcher only in enforce_set_cookie_cache_privacy (line 174), keep response_is_uncacheable on the broad cache_control_headers_are_private_or_no_store, and add a unit case for this exact input. The new doc in cache_policy.rs:347-348 already says generic matching is right for conservative vetoes, and this is one.
| Fastly and Axum already issue EC cookies through the shared identity lifecycle. | ||
| They gain optional same-value renewal. Cloudflare and Spin do not issue EC | ||
| cookies in #1646: they bind no identity record store, and their publisher paths | ||
| only read incoming identity. Their responses remain identical to the live #1661 base for both |
There was a problem hiding this comment.
R2 · Nonblocking: the shared egress fixes contradict "Cloudflare/Spin identical". Instead of renewal-only privacy, this fixed the shared helpers (qualified-private downgrade, insert → append for operator Set-Cookie), which now change every adapter whether renewal is on or off. That's a defensible fix, but this line still says Cloudflare and Spin "remain identical to the live #1661 base", which isn't true for a response with an origin plus an operator Set-Cookie, or a cookie plus qualified private. The PR body says the same. Preferably split those two fixes (with their tests and the R1 correction) into a small PR against feat/1592-ja4-ua-contradiction, so general privacy fixes don't wait on the DEC-13 decision. At minimum, qualify this line and the PR body.
| This authoritative browser reference justifies the validation bound; it does | ||
| not promise that browsers retain cookies for the entire requested lifetime. | ||
|
|
||
| Both defaults are omitted when serializing configuration. With no new settings, |
There was a problem hiding this comment.
R3 · Nit: with the new sentence inserted, "That includes WB-1..." now reads as if WB-1 expiries are among the cases where parity isn't claimed, when they're part of the preserved baseline. Move "That includes WB-1..." right after the #1661 parity sentence, put "Shared response hardening..." after it, and rewrap (one line is 130 characters).
Proposal for DEC-13; off by default; do not merge until DEC-13 is formally decided and #1595's returning-reader no-Set-Cookie acceptance rule is adjusted.
Summary
ts-ecrefresh for returning readers without breaking cacheability #1595.Changes
crates/trusted-server-adapter-axum/tests/native_ec.rscrates/trusted-server-adapter-cloudflare/tests/routes.rscrates/trusted-server-adapter-fastly/src/app.rscrates/trusted-server-adapter-spin/tests/routes.rscrates/trusted-server-core/src/config.rscrates/trusted-server-core/src/ec/app.rscrates/trusted-server-core/src/ec/app/lifecycle.rscrates/trusted-server-core/src/ec/app/sliding_tests.rscrates/trusted-server-core/src/ec/cookies.rscrates/trusted-server-core/src/ec/finalize.rscrates/trusted-server-core/src/ec/mod.rscrates/trusted-server-core/src/settings.rsdocs/guide/configuration.mddocs/guide/ec-setup-guide.mddocs/guide/edge-cookies.mddocs/superpowers/plans/2026-11-23-ec-sliding-expiration-proposal.mddocs/superpowers/specs/2026-11-23-ec-sliding-expiration-proposal-design.mdtrusted-server.example.tomlec.max_age_daysdefaults to 365 and accepts integers from 1 through 400; invalid values fail configuration loading with a field-specific error.ec.sliding_refreshdefaults to false. Custom lifetime applies to creation/rotation even with renewal disabled. Withdrawal still expires EC immediately.Renewal uses the existing method/status/document rules, including HTML error documents, non-GET document navigations and document 304s. Named EC/API routes and configured GET/HEAD assets do not renew. A client the configured browser gate refuses, including trusted JA4 contradictions and strict-mode checks, gets no navigation permit, so its EC is never renewed. Unread/unavailable records allow renewal; known missing, revoked or failed records and failed navigation writes suppress it. Out-of-band revocation remains unobserved until a request reads the record.
This changes browser lifetime only, not record retention. SharedID, its consent companion and the EID mirror keep their independent one-year lifetimes. Some returning-reader pages are already private; others can retain public origin policy today and lose that cacheability when renewed. Neutral cookie-free raw templates retain their separate policy and configured SharedID key exclusion.
Closes
Closes #1595
Stacked on #1661 (
feat/1592-ja4-ua-contradiction), which carries the shared identity lifecycle, configured SharedID handling and trusted JA4 browser gate. Completion requires the formal DEC-13 decision and the corresponding WB-2/WB-5 acceptance update before merge.Spec
Spec: Configurable EC lifetime and sliding-expiration proposal.
Plan: Implementation and verification plan.
The spec ends with its review log: two independent agent rounds after merging #1646 at
aa315593f.Test plan
Checked hosted CI items below passed on
fbe5670ac; they are not claims that the full CI matrix was run locally.cargo test-fastly && cargo test-axum— hosted CI; local Fastly adapter (248 passed, 6 ignored; same withreusable-sandbox) under isolated Viceroy 0.21.0 andcargo test-axum(122) passed.cargo clippy-fastly && cargo clippy-axum— hosted CI (Run Format workflow) and clean locally.cargo fmt --all -- --check— hosted CI and local.cd crates/trusted-server-js/lib && npx vitest run— hosted CI.cd crates/trusted-server-js/lib && npm run format— hosted CI.cd docs && npm run format— hosted CI; changed docs also pass the pinned Prettier locally.cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1— hosted CI.fastly compute serve— not rerun for the sliding-expiration revision; no current real-browser or deployed-cache proof is claimed.aa315593f): core library (3,814 passed), Axum (122), Cloudflare routes (35), Spin routes (47), Fastly adapter (248) andcargo check-fastly --tests; Cloudflare/Spin response parity; touched-target clippy. A mutation check confirmed the invalid-cookie test reaches the renewal gate.fbe5670ac, including runtime/browser integrations. These do not establish Safari/ITP or deployed-cache behavior for enabled sliding renewal.Checklist
unwrap()in production code — useexpect("should ...").logmacros, notprintln!.ts-ecrefresh for returning readers without breaking cacheability #1595's acceptance wording adjusted before merge.Review corrections
Require whole-response privacy for cookie output; preserve unrelated configured cookies without duplicates; skip optional renewal when the origin already mutates
ts-ec; bind renewal authorization to the current document finalization and confirmed navigation. Operator rollout and baseline documentation are corrected. Focused routed, permission-reuse and privacy regressions pass locally. All 33 GitHub Actions checks pass on6398e976d5723244cb9a085718c53308cf3958bf. The browser-acceptance job passed on retry after an external Ubuntu package-download timeout. The optional Cloudflare/Spin test deduplication remains deferred so each adapter command retains its coverage. DEC-13 and the WB-2/WB-5 acceptance update remain merge gates.