Skip to content

Proposal: Configure EC lifetime and renew it on eligible visits (DEC-13) - #1655

Open
prk-Jr wants to merge 15 commits into
feat/1592-ja4-ua-contradictionfrom
proposal/1595-ec-threshold-refresh
Open

prk-Jr wants to merge 15 commits into
feat/1592-ja4-ua-contradictionfrom
proposal/1595-ec-threshold-refresh

Conversation

@prk-Jr

@prk-Jr prk-Jr commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Make the EC browser-cookie lifetime configurable and offer same-value renewal on every eligible consented document visit, implementing the team's sliding-expiration direction for ts-ec refresh for returning readers without breaking cacheability #1595.
  • Replace the never-deployed threshold/companion-cookie design. Defaults keep renewal disabled and retain the live Refuse EC creation when a trusted JA4 contradicts the UA #1661 baseline's storage operations and cookie lifetime attributes. Shared privacy and cookie-preservation corrections also apply with renewal disabled; exact parity is not claimed for previously unsafe responses. Renewal adds no record reads or writes.
  • Preserve consent and shared-cache protections: every renewing response carries Set-Cookie and is private. Fastly/Axum gain optional renewal; Cloudflare/Spin remain unchanged.

Changes

File Change
crates/trusted-server-adapter-axum/tests/native_ec.rs Verify same-value document renewal, configured lifetime, privacy and route exclusions.
crates/trusted-server-adapter-cloudflare/tests/routes.rs Compare complete responses with omitted, disabled and enabled settings; preserve unsupported EC routes.
crates/trusted-server-adapter-fastly/src/app.rs Add routed renewal tests through late identity finalization and terminal privacy enforcement; production routing is unchanged.
crates/trusted-server-adapter-spin/tests/routes.rs Compare complete responses across settings and preserve unsupported EC routes.
crates/trusted-server-core/src/config.rs Test configuration loading, lifetime defaults and invalid bounds.
crates/trusted-server-core/src/ec/app.rs Register the sliding-expiration regression suite.
crates/trusted-server-core/src/ec/app/lifecycle.rs Authorize optional renewal using the existing final document eligibility rules.
crates/trusted-server-core/src/ec/app/sliding_tests.rs Cover record states, zero extra I/O, default parity, consent, routes, lifetime, cache privacy and clients refused identity creation.
crates/trusted-server-core/src/ec/cookies.rs Use the configured lifetime in every positive EC cookie formatter; preserve withdrawal Max-Age=0.
crates/trusted-server-core/src/ec/finalize.rs Renew held ECs after the existing consent/write gates; keep the EID mirror lifetime independent.
crates/trusted-server-core/src/ec/mod.rs Carry request-local document authorization for optional renewal.
crates/trusted-server-core/src/settings.rs Add validated max_age_days (1–400, default 365) and default-disabled sliding_refresh; omit defaults when serializing.
docs/guide/configuration.md Document settings, enable/disable behavior, cache impact and merge restrictions.
docs/guide/ec-setup-guide.md Distinguish default no-renewal checks from enabled sliding renewal.
docs/guide/edge-cookies.md Qualify lifecycle diagrams and returning-reader guidance; document the independent mirror lifetime.
docs/superpowers/plans/2026-11-23-ec-sliding-expiration-proposal.md Describe implementation and targeted verification for the sliding proposal.
docs/superpowers/specs/2026-11-23-ec-sliding-expiration-proposal-design.md Specify lifetime validation, eligibility, approved record-state behavior, privacy, compatibility and retention limits.
trusted-server.example.toml Show optional lifetime and renewal settings with default/example values.

ec.max_age_days defaults to 365 and accepts integers from 1 through 400; invalid values fail configuration loading with a field-specific error. ec.sliding_refresh defaults 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 with reusable-sandbox) under isolated Viceroy 0.21.0 and cargo 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.
  • JS tests: cd crates/trusted-server-js/lib && npx vitest run — hosted CI.
  • JS format: cd crates/trusted-server-js/lib && npm run format — hosted CI.
  • Docs format: cd docs && npm run format — hosted CI; changed docs also pass the pinned Prettier locally.
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1 — hosted CI.
  • Manual testing via fastly compute serve — not rerun for the sliding-expiration revision; no current real-browser or deployed-cache proof is claimed.
  • Other (local, on the merge with Run Axum identity through the shared application #1646 aa315593f): core library (3,814 passed), Axum (122), Cloudflare routes (35), Spin routes (47), Fastly adapter (248) and cargo check-fastly --tests; Cloudflare/Spin response parity; touched-target clippy. A mutation check confirmed the invalid-cookie test reaches the renewal gate.
  • All 29 hosted checks across six workflows passed on fbe5670ac, including runtime/browser integrations. These do not establish Safari/ITP or deployed-cache behavior for enabled sliding renewal.
  • Independent full-diff review of the merge found no blocking issues; its one test finding (the invalid-cookie leg bypassed the renewal gate) is fixed. Creation and rotation tests now assert exactly one EC Set-Cookie. Optional hardening remains for the redundant inner state gate.

Checklist

  • Feature PRs: spec linked above, ending in a review log of two or more agent review rounds.
  • Changes follow AGENTS.md coding conventions.
  • No unwrap() in production code — use expect("should ...").
  • Uses log macros, not println!.
  • New code has tests.
  • No secrets or credentials committed.
  • No new runtime environment reads, dependencies, record schema or EdgeZero changes.
  • DEC-13 formally recorded and ts-ec refresh 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 on 6398e976d5723244cb9a085718c53308cf3958bf. 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.

@prk-Jr prk-Jr self-assigned this Nov 23, 2026
@prk-Jr prk-Jr linked an issue Nov 23, 2026 that may be closed by this pull request
2 tasks
@prk-Jr prk-Jr changed the title Propose off-by-default EC threshold refresh for DEC-13 Proposal: Off-by-default EC threshold refresh for DEC-13 Nov 23, 2026
@prk-Jr prk-Jr changed the title Proposal: Off-by-default EC threshold refresh for DEC-13 Proposal: Configure EC lifetime and renew it on eligible visits (DEC-13) Nov 23, 2026
@prk-Jr
prk-Jr marked this pull request as ready for review November 23, 2026 18:16
PR #1532 now reads the native Geo profile path from
TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE instead of TS_NATIVE_GEO_PROFILE_FILE. No file in this PR
uses the old name after the merge, so the merge only takes the rename from
PR #1646. The merge had no conflicts.
@aram356

aram356 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

For #1532's rename of the native Geo profile variable to TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE, I pushed 668d5014b here, one merge of this PR's base:

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.

prk-Jr and others added 2 commits November 25, 2026 16:27
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.
@aram356
aram356 changed the base branch from feat/1574-axum-shared-identity to feat/1592-ja4-ua-contradiction November 25, 2026 20:11
aram356 added a commit that referenced this pull request Nov 25, 2026
#1655 (b76163b) now sits on #1661 and resolves its Cloudflare route test
conflict with #1661 in its own merge. The merge is clean.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed b76163b0c, a merge of #1661's new head fb7793a0e onto this PR's fbe5670ac. This PR now stacks on #1661 instead of #1646, so rc/identity can take both as plain merges, and the merge also brings #1626, #1656, #1661 and #1636, with #1617's health contract below them and #1506's repin of EdgeZero to rc/identity at d063a8e7 with main's Fastly SDK upgrade (#1671). Resolutions:

I changed the base to feat/1592-ja4-ua-contradiction (#1661).

#1661's new head b33c45b brings #1537's b181544, "Accept any Fastly EC
store link name at startup", which #1537's owner merged up through #1539,
#1538 and #1540. The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1655 (dfb8e34) carries #1537's b181544, "Accept any Fastly EC store link
name at startup", through the chain below it. The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed dfb8e3449, a merge of #1661's new head b33c45b39. It brings #1537's b181544a0, "Accept any Fastly EC store link name at startup", which #1537's owner merged up through #1539, #1538 and #1540. The merge had no conflicts.

Takes #1661's new head 62543b0, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1655 (3b79136) carries #1506's repin of EdgeZero to rc/identity at
459bd27d (42e0c46), with PR 275 at 0e2a58ae, the stack's test fixes and
EdgeZero 536's bounded record update, RecordHandle::update, through the
chain below it. The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 3b7913622, a merge of #1661's new head 62543b0f7, which brings #1506's repin of EdgeZero to rc/identity at 459bd27d (42e0c46c7): EdgeZero #275 at 0e2a58ae, the EdgeZero stack's test fixes and EdgeZero #536's bounded record update, RecordHandle::update. The merge had no conflicts.

#1661's new head 2e0bbb0 brings #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1655 (a93595c) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed a93595c85, a merge of #1661's new head 2e0bbb0cb, which brings #1539's cf4e815d4, the native container test's failure-router expectation, and #1646's a18abf428, the reworked KV check in the store metadata test. The only change to this PR's tree is that store test. The merge had no conflicts.

@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 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-ec cookie 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-ec can produce a second ts-ec header: on an eligible page, an origin Set-Cookie: ts-ec can pass through. The response may then carry two ts-ec headers. 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-Cookie for 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

Takes #1661's new head 5d951a7, which carries #1506's repin of EdgeZero to
rc/identity at 1619078a (8edc50e), a revert that removes EdgeZero 522
(portable Fastly record providers) and 524 (outbound mTLS client
identities).

The merge is clean.
aram356 added a commit that referenced this pull request Nov 27, 2026
#1655 (8560f8e) carries #1506's repin of EdgeZero to rc/identity at
1619078a (8edc50e), a revert that removes EdgeZero 522 (portable Fastly
record providers) and 524 (outbound mTLS client identities), through the
chain below it. The merge is clean.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 8560f8e3a.

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 ChristianPavilonis 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 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.

Comment thread docs/guide/configuration.md Resolved
Comment thread docs/guide/configuration.md Resolved

@ChristianPavilonis ChristianPavilonis 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.

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 {

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.

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

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.

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,

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.

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).

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

Development

Successfully merging this pull request may close these issues.

ts-ec refresh for returning readers without breaking cacheability

4 participants