Repository navigation
Conversation
Fastly already starts provider lookups at navigation, collects them against one shared deadline inside the single finalize bridge and writes their IDs in the page-load write. These tests pin the acceptance criteria: a lookup answering within the deadline reaches the record and the mirror cookie of the same navigation response, one past the deadline is skipped and releases the response at the deadline, the registered ID5 provider puts its UID in the minted record and the mirror of the navigation that mints the EC, and identity cookies are set on navigations but never on subresource, auction or page-bids responses. Part of #1591 (ID-4, WB-1). Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
The Fastly navigation parked its in-flight provider batch and its after-response signals in a request-local thread_local for finalize to take. The batch is not Send, so it cannot ride in response extensions. The handler now collects the page-phase lookups once the response status is known, skipping a redirect as before, and the results reach finalize on the EC context. The after-response signals travel in EcFinalizeState. Lookups still start before the origin fetch, so their wait overlaps it, and still complete before EC finalization. Tests drive routing on the fixture clock so collection can reach the lookup deadline. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
ID-8 keeps main's behaviour: EIDs in the /auction request body are saved to the record. /auction is not a page load and holds no page-load permit, so the body EIDs go in one conditional write of their own (KvIdentityGraph::commit_auction_ingest) under browser-ingest rules: consent-gated, SharedID opt-out applied, filling only partner UIDs a live row lacks and never a provider-owned source. The row must have been read live; the write never creates or recovers a row and a conflict drops the EIDs without a retry. The request's ts-eids and sharedId cookies are still left to the next navigation, so the endpoint now hands finalize only the body's EIDs. The navigation's single page-load write is unchanged. Update the S2S EID collection spec, the edge cookies guide and the changelog, which said body EIDs are never stored. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
…rral Identity cookies are set only on navigation and EC route responses; expiry Set-Cookie headers for a withdrawal or a mirror revocation are allowed on any response. Rename the Fastly test and let it ignore expiries, and say so in the S2S spec. Note in the spec that Axum's after-response follow-up writes (ID-5) are deferred to #1581. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
|
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 #1641. 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. |
…1622 into rc/identity #1622 (244ca26) now carries the whole chain, each PR merging the one below it: - #1506 (c197404) repins EdgeZero to rc/identity at d063a8e7, which carries EdgeZero main's Fastly SDK 0.13.3 upgrade through every EdgeZero PR here, and merges Trusted Server main's upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. - #1614, #1525, #1526, #1487 and #1488 take it in turn. #1488 also adds b2d4bfd, which records known UID hashes with a setter. - #1489, the identity spine (#1639, #1640, #1612, #1628 and #1623), #1531 and #1532. - The Axum serving line: #1613, #1616, #1617, #1615, #1635, #1637 and #1627, chained, with #1627's b958107 decoding the Spin discovery document with Response::json and #1627's merge of #1625, which brings #1625's Wrangler pin into the chain. - The held line on #1627: #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646. #1646 keeps its own shared after-response runner in ec::app::lookups. - #1636 (72096cd) on #1646 (b5a5f62), draining Axum after-response identity tasks on SIGTERM through #1646's shared runner. - The EC route line on #1636: #1626 (067531e), which merges #1636, the draft #1656, #1661, #1662 and #1622, and through #1622's merge of it, #1620's round-6 head. Each conflict was resolved in the PR that sits higher. This merge is clean. Since the last update the chain also takes #1488's hashed-email intake (a610152 and 9104fd3) and its POST, body and header options for the status call (f063a76), #1627's split of the generic runtime KV store into trusted_server_runtime_kv (4d0c1a2), #1646's gate on identity writes for rejected clients (aa31559) its native container test of the failure router (4f4c036) and that test's header check on an ordinary route (71a573a), #1626's withholding of a mirrored UID while another source owner is opted out (d07f789), and #1617's description of the Axum startup failure router (6d174a8) and of the startup failures that still exit before listening (4c07cad). #1636 no longer sits in the Axum serving line; it arrives through #1626, which merges it on top of #1646. Its new head adopts #1646's after-response runner in place of the one rc/identity took with cf1102c. Cloudflare guide: #1627's merge of #1625 now keeps both #1625's tool version clause and #1627's TRUSTED_SERVER_RUNTIME_KV binding in the smoke paragraph, and fixes #1625's smoke script test for #1617's Python floor and Worker build, and #1537's merge fixes its ts stub for #1537's storage template step, so this merge needs no resolution.
|
For the identity integration branch (#1608), I pushed
|
|
For the identity integration branch (#1608), I pushed |
prk-Jr
left a comment
There was a problem hiding this comment.
Approving. This PR moves Fastly page-phase identity lookup collection out of the NAVIGATION_LOOKUPS thread-local and into the handler. Collection now runs once the response status is known, a redirect drops the batch without waiting, and only the Send results travel on EcContext. After-response work now goes to post-delivery on EcFinalizeState. The PR also adds tests for ID-4 and WB-1 on Fastly, and it saves /auction body EIDs to a live row again (ID-8) through a separate conditional write, commit_auction_ingest.
I traced the following and found no blocking problems:
- Lifecycle: removing the thread-local leaves nothing that can outlive the request. Detached responses never had page lookups to release. The
after_responsehandoff still runs afterapply_edgezero_ec_finalize, which sets the after-response permit, so post-delivery gating is the same as before. /auctioningest gating:- It runs only after the
consent_allows_ecearly return. The updates pass throughgate_eid_updates_by_consent(Purpose 1 + 4) and the SharedID opt-out filter. plan_writerefuses a non-consented row or a snapshot without a generation.apply_browser_ingestskips provider-owned sources and fills only vacant ones.- It writes only for a returning EC with a live, consented row (no create, no orphan recovery), and it does not write when nothing changes.
- It runs only after the
- Cookie fallback: the
ts-eidscookie fallback still reaches bidders but is no longer put onec_context, so the cookie is not persisted from/auction. - Cookies on
/auction: finalize passesnow: Noneon/auction, so no mirror cookie is set there, which matches WB-1.
One non-blocking finding is inline: /auction adds a writer whose write can conflict with an in-flight navigation's page-load write, which the spec text says is unaffected.
Verification
- Native
cargo test -p trusted-server-core --lib -- auction ec::finalize ec::kv: 645 passed atf2c268ae7. - Broken control: with the
commit_auction_ingestcall removed,finalize_saves_auction_body_eids_to_missing_partner_uidsandauction_body_eids_reach_context_and_kvfail.finalize_auction_body_eids_never_create_a_rowpasses either way, as a guard on absence should. - The Fastly adapter tests (the new ID-4/WB-1 tests) were not run locally because the local Viceroy is older than the pinned 0.21.0. I rely on CI
cargo test, which passes at this head. - CI at
f2c268ae7: everything passes exceptlocal-provider-image, which fails withinvalid-envelope must not listen. The base head0a18d37aa(#1641) fails the same assertion and this PR does not touch that image, so the failure is pre-existing and unrelated.
| and a conflict drops the EIDs without a retry. This does not break "a page load | ||
| writes the record once": `/auction` is not a page load, holds no page-load | ||
| permit, and the navigation's own write is unchanged. The `/auction` request's |
There was a problem hiding this comment.
Non-blocking: "the navigation's own write is unchanged" holds for its code path, but /auction is now a writer that can make that write fail.
A navigation plans its page-load update against the generation it read at request start and writes it at finalize, after the origin fetch and the lookup budget. Per D4, a Conflict there is not retried. Suppose an /auction from the previous page (or another tab) fills a missing partner UID inside that window. Its commit_auction_ingest moves the generation, so the navigation's conditional write is dropped, along with that navigation's provider lookup results and cookie ingest. Mirror changes then wait for a later navigation.
The window is bounded because /auction writes only when its body fills a vacant source, so I don't think the code needs to change. Please add a sentence here, e.g. "an /auction save that lands between a navigation's read and its write makes that navigation's write conflict (D4)", so the spec does not claim the navigation is unaffected.
|
For the identity integration branch (#1608), I pushed |
|
For the identity integration branch (#1608), I pushed Takes #1641's new head 04cb794, 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. |
| return; | ||
| } | ||
| let Some(RowChange::Update { entry, expected }) = | ||
| commit.plan(ec_context, commit.ec_id, ec_context.kv_snapshot(), None) |
There was a problem hiding this comment.
Keep the SharedID migration out of auction ingest. I tested a row with a legacy sharedid.org UID, an auction carrying _pubcid_optout, and a new body EID for an unrelated partner. The CAS saved the unrelated EID and moved the opted-out UID to pubcid.org. It did the same when pubcid.org was provider-owned. drop_opted_out_sharedid_updates filters the incoming EIDs, but plan_write still runs refile_legacy_sharedid on the stored row. Can we leave that migration to navigations and add a regression test that reads back both entries after the auction?
| } | ||
|
|
||
| #[test] | ||
| fn page_lookup_within_the_deadline_reaches_the_record_and_the_mirror_cookie() { |
There was a problem hiding this comment.
Exercise a successful document response in the ID-4 tests. I ran both deadline tests and the ID5 test under Viceroy 0.22.0. All three passed with /article returning 502: the fixtures script the provider but not the publisher origin. That checks the row and mirror on an error response, and misses a regression that starts provider work after the origin finishes. Could we script a delayed 200 HTML response, assert success, and check the recorded sends for overlap? The late case should distinguish the original cutoff from a fresh budget started after the origin returns.
| ), | ||
| ( | ||
| "auction API", | ||
| browser_request(Method::POST, "/auction", "empty"), |
There was a problem hiding this comment.
Use admitted requests for the WB-1 API cases. Under Viceroy this test passed with /auction returning 400 for the empty body and /_ts/page-bids returning 403 at the admission check. It would miss a cookie set only on success. Please send valid consented requests with a live row and assert success before checking headers. Include the configured SharedID cookie and its _cst companion in the matcher, while still allowing expiry headers.
| TS-->>B: Auction response + x-ts-eids header when available | ||
| TS->>KV: Add missing partner UIDs from request eids[]<br/>+ ts-eids/SharedID cookies (TCF Purpose 1 + 4 under GDPR) | ||
| TS->>KV: Add missing partner UIDs from request eids[]<br/>to a live row (TCF Purpose 1 + 4 under GDPR) |
There was a problem hiding this comment.
Non-blocking: show the CAS before delivery. Fastly awaits the auction write in response finalization, before sending the response. The design spec's §9.1 also still says no other request can write at all; that should refer to the permit-gated navigation write and point to the separate auction CAS in §5.4.
| TS-->>B: Auction response + x-ts-eids header when available | |
| TS->>KV: Add missing partner UIDs from request eids[]<br/>+ ts-eids/SharedID cookies (TCF Purpose 1 + 4 under GDPR) | |
| TS->>KV: Add missing partner UIDs from request eids[]<br/>to a live row (TCF Purpose 1 + 4 under GDPR) | |
| TS->>KV: Add missing partner UIDs from request eids[]<br/>to a live row (TCF Purpose 1 + 4 under GDPR) | |
| TS-->>B: Auction response + x-ts-eids header when available |
PR #1641's new head brings wave B: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806, carried up through the chain. The merge is clean. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
|
Round 12 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
PR #1641's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678), #1535's move of the consent-update test host to publisher.example.com for the URL-host lint and #1540's allow-domain marks on the deployment guide's reference links. The merge is clean.
PR #1641's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage and #1535's Sourcepoint consent mirror deduplication and consent update coverage. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
PR #1646's new head brings the identity chain above #1540 that #1667 did not carry yet: #1566's move of the identity stack onto the native EC stack, #1624's SharedID creation and write-back from the EC record, #1641's lazily opened EC record store in core, #1642's verified identity lookups and saved /auction body EIDs, and #1646's Axum identity through the shared application. crates/trusted-server-adapter-axum/src/app.rs: #1667 added mtls_auction_provider_fails_startup before Axum's enabled_identity_provider_fails_startup, and #1646 renamed that test to unknown_identity_provider_fails_startup because Axum now runs identity providers. The resolution keeps #1667's mTLS startup test followed by #1646's renamed test. crates/trusted-server-cli/src/checked_app_config.rs: #1667 extended the adapter doc to say that the Fastly-only split also holds for auction providers that set mtls, and #1646 rewrote it to say that Fastly and Axum run the shared coordinators. The resolution says that Fastly and Axum run identity providers and that only Fastly accepts mtls auction providers. The semantic fix below then replaces that function. Semantic break in crates/trusted-server-cli/src/checked_app_config.rs and run.rs: #1646 moved the Axum target of ts config push and diff from ProviderlessAppConfig to CheckedAppConfig by making adapter_runs_identity_providers return true for axum, and #1667 placed its reject_auction_mtls check only in ProviderlessAppConfig. The merge compiles, but the CLI then accepts an mtls auction provider for Axum that the Axum adapter refuses at startup. The fix belongs in this link because it is where the two changes first meet. adapter_runs_identity_providers becomes adapter_support, which returns ProvidersAndMtls for fastly, ProvidersOnly for axum and Neither for every other adapter, and push and diff match on it. A new NoMtlsAppConfig adds only the reject_auction_mtls check to CheckedAppConfig, and ProviderlessAppConfig now wraps NoMtlsAppConfig and adds reject_enabled_providers, so the mTLS rejection exists once. validate stays adapter-agnostic on CheckedAppConfig. The tests cover the adapter mapping, an Axum target that rejects an mtls auction provider under auction_providers and accepts an enabled identity provider, a Fastly target that accepts the mtls provider, and Cloudflare and Spin targets that reject both. The CLI paragraph of the auction provider mTLS spec now names NoMtlsAppConfig for Axum. Cargo.lock matches #1646's new head: next to #1667's, it adds only #1646's trusted-server-identity-providers dependency of the Axum adapter; the codegen crate's nested Cargo.lock is unchanged.
|
Round 15 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
|
Cascade of #1533's Axum startup-test port fix ( |
…tegration chain
|
Merged #1627's runtime KV removal ( At the maintainer's request, that commit removes the generic runtime KV store Only that commit was merged, not the base branch's new head. Conflicts were resolved in Checks on this head: no reference to the removed store remains and |
|
Round 17 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1641's new head ( Checks on this head: no conflict markers; |
Summary
thread_localfor Fastly page lookups: the handler collects them once the response status is known, before finalize, and carries only the results on the EC context./auctionrequest-body EIDs to the EC row again (ID-8), under browser-ingest rules, in one conditional write to an existing row./auctionis not a page load, so "a page load writes the record once" still holds.Changes
crates/trusted-server-adapter-fastly/src/app.rsNAVIGATION_LOOKUPSthread-local); after-response signals move intoEcFinalizeState. Tests:page_lookup_within_the_deadline_reaches_the_record_and_the_mirror_cookie,page_lookup_past_the_deadline_is_skipped_without_delaying_the_response,id5_lookup_reaches_the_minted_record_and_the_mirror_of_the_same_navigation,identity_cookies_are_set_only_on_navigations_and_may_expire_anywhere.crates/trusted-server-adapter-fastly/src/main.rs,post_delivery.rscrates/trusted-server-core/src/ec/kv.rsKvIdentityGraph::commit_auction_ingest: one conditional write to a live row the request read; never creates or recovers a row, no retry.crates/trusted-server-core/src/ec/finalize.rs,ec/mod.rs,auction/endpoints.rs/auctionpasses its body EIDs to finalize (fill-missing, consent-gated, SharedID opt-out applied, provider-owned sources protected); cookies still wait for the next navigation. New finalize tests; the endpoint test now expects the EIDs saved.docs/superpowers/specs/2026-10-30-s2s-eid-collection-design.md,docs/guide/edge-cookies.md,CHANGELOG.md/auctionbody EID persistence (D1, §5.4, §5.5, §12.3), the WB-1 rule, and the Axum deferral.WB-1 reading: identity cookies are set only on navigation and EC route responses; expiry
Set-Cookieheaders (withdrawal, mirror revocation) may appear on any response.Not in this PR:
ctx.after_responsewith the SIGTERM drain.Closes
Closes #1591
Spec
Spec: server-side identity on every adapter, ID-4, ID-5, WB-1
Test plan
cargo test-fastly && cargo test-axum(alsotest-fastly-reuse,test-cloudflare,test-spin, parity, build-digest, CLI tests)cargo clippy-fastly && cargo clippy-axum(all clippy aliases, including CLI and codegen)cargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest run(3350 pass;test/trace/collector.test.ts"invalidates capture on checked eviction overflow" times out locally at ~16 s vs 15 s, also on the base branch, with no JS change in this stack)cd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute servescripts/lint-wasm-clock.shChecklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!)