Repository navigation
Pre-ramp RC: auction provider mTLS, origin client IP, and their stack - #1674
Draft
ChristianPavilonis wants to merge 974 commits into
Draft
ChristianPavilonis wants to merge 974 commits into
ChristianPavilonis wants to merge 974 commits into
Conversation
Brings PR #1487 onto PR #1526's base (PR #1506's EdgeZero cutover, PR #1614, PR #1525 and PR #1526's awaitable EC persistence) and keeps PR #1487's behavior in the new base's structure. How each area was resolved: - Provider lookups: the lookup transport now sends through EdgeZero's outbound client in the auction fan-out's shape. `LookupTransport::start` takes every built request and starts them as one batch with `HttpClient::start_batch_until` and a cutoff of the identity budget, taken on the client's own clock; `gather` reads the batch until it finishes, maps slots back to providers and reports unresolved slots as timeouts. `PlatformLookupTransport` and the coordinator's web-time `Deadline` are replaced by `OutboundLookupTransport`; requests keep the 64 KiB response cap, cache bypass and strict TLS. - Deleted modules: `platform/http.rs` and the Fastly `platform/deadline.rs` stay deleted. PR #1487's final-snapshot change to the Fastly deadline select (a 1 ms surfacing wait per pending body and counting arrived headers as progress) has no counterpart in EdgeZero's batch and is not ported, nor is its doc-only change to `select_until`. - Async KV: `ec/kv.rs`, `ec/mod.rs` and `ec/finalize.rs` take PR #1487's versions converted to PR #1526's async store; the page-load and after-response writes, the write planner, after-response commit, batch sync's provider-owned check and their tests await the store. Unchanged tests take PR #1526's async versions, and PR #1526's non-Send yielding store test is kept. `generate_if_needed` stays async as on the base. - Fastly entry point: `main.rs` takes the base's lifecycle. `finalize` collects the navigation's page-phase lookups inside the async EC finalize under its one `block_on`, using the partner registry built once in `AppState`. After-response lookups run in post-delivery work, after pull sync, on the post-delivery client and clock. Lookups still travel through the request-local slot, because an in-flight batch is not `Send`; the slot is now cleared before each request and after delivery. - Fastly app: keeps the base's local 501/405 identify and batch-sync answers, publisher origin options and response-body scope owner, with PR #1487's partner registry, identity coordinators, navigation permit and dispatch. - Other adapters, core call sites and tests: kept both sides; PR #1487's tests that used the removed platform HTTP client or a custom auction provider now use the scripted outbound client, and the Fastly identity tests route with the host geo lookup the entry point's `prepare` runs. - Cargo: the lockfile adds only the identity-providers crate to the base's. - Docs and CHANGELOG: auction collection text follows the base; PR #1487's identity entries and spec now describe the EdgeZero batch transport.
Brings PR #1488's vendor identity providers onto PR #1487's new head, which carries PR #1487 onto PR #1526 (EdgeZero cutover, local partner API answers, HTTP auction opt-in and awaitable EC persistence). How each area was resolved: - Coordinator: PR #1488's cookie reads, GDPR source exclusion, opt-out memory and merged results run inside PR #1487's batch-shaped dispatch. The lookups a navigation still needs are built first and start together in one EdgeZero batch; `PendingLookups::is_empty` counts started requests along with cookie, generated and early results. - Fastly entry point: `main.rs` takes PR #1487's EdgeZero version. The provider cookies PR #1488 hands to after-response lookups go into the after-response `LookupContext` in post-delivery work; the request-side cookie capture merged unchanged. - Async KV: PR #1488's new write-plan and identify tests await the store. - Providers crate, CLI and settings: merged without conflict; providers stay pure and make no HTTP calls of their own. - Cargo: the textual merge pointed `crypto-common` at a `getrandom` the lockfile no longer held; cargo resolved it to the locked 0.4.2. The rest of the lockfile delta is PR #1488's own.
Brings PR #1489's pull-sync provider and EID mirror onto PR #1488's new head, which carries PR #1487 onto PR #1526 (EdgeZero cutover, local partner API answers, HTTP auction opt-in and awaitable EC persistence). How each area was resolved: - Pull sync: core `ec/pull_sync.rs` stays deleted, so the base's EdgeZero group sender and its tests go with it. Pull sync runs as PR #1489's `pull-sync` after-response provider, sent through the post-delivery client in the lookup batch. Post-delivery work is now telemetry, then after-response lookups; the separate pull-sync step, its graph factory and the unused clock are removed, and PR #1489's "nothing due" check runs before the live row read. `require_identity_graph`, now used only by tests, is test-only. - Coordinator: PR #1489's dispatch order and per-navigation pull-sync cap run inside PR #1487's batch-shaped dispatch; the cap counts each queued pull-sync request. - Fastly app: `EcFinalizeState` drops both the old `services` and `is_real_browser`; the bot gate moves into after-response capture as in PR #1489, with the base's request services and async batch sync. - Async KV and finalize: PR #1489's removals in `kv.rs` (snapshot partner upsert) and the pull-sync marker stand; the mirror and the inner finalize are awaited, and PR #1489's new tests await the store. - Publisher: keeps the base's EdgeZero origin request without the marker preload inputs PR #1489 removed. - Providers crate: PR #1489's pull-sync providers and PR #1488's SharedID cookie defaulting both apply when the phase coordinators are built. - Docs and CHANGELOG: the base's auction wording with PR #1489's identity bullets; the onboarding step names after-response lookups.
A shared identity app built once holds both in state that EdgeZero handlers capture, which must be Send and Sync. Every existing implementation already is. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
IdentityApp holds the settings, partner registry, EC record store and rate limiter that adapters supply through IdentityPlatform. An adapter without a limiter gets NoRateLimit. No adapter uses it yet. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
IdentityApp::mount registers GET on /_ts/admin/ec, /_ts/admin/ec/{id} and /_ts/admin/eids with the registry and record store built once. Identify and batch sync stay in the adapters until the EC lifecycle moves into core.
Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
AppState now holds an IdentityApp with Fastly's EC record store and Edge Rate Limiting counter. Identify, batch sync, auction, page bids, the publisher fallback, EC finalization and pull sync use its registry, store and limiter instead of rebuilding them per request, and the admin lookups are mounted from core. Fastly's limits are unchanged. Signed-off-by: dhruv8sh <dhruv8sh@proton.me> # Conflicts: # crates/trusted-server-adapter-fastly/src/app.rs # crates/trusted-server-adapter-fastly/src/main.rs
The Axum dev server builds an IdentityApp once with no EC record store and no rate limit, since its deployer limits traffic at the load balancer. The per-request partner registry for the EIDs echo is gone. The HTTP client stays per request. Signed-off-by: dhruv8sh <dhruv8sh@proton.me> # Conflicts: # crates/trusted-server-adapter-axum/src/app.rs
…entity app Both adapters build an IdentityApp with their app state and no EC record store, so admin EC lookup answers 501 from core. This drops their duplicate admin_ec_lookup_not_supported wrappers and the per-request partner registry for the EIDs echo. Signed-off-by: dhruv8sh <dhruv8sh@proton.me> # Conflicts: # crates/trusted-server-adapter-cloudflare/src/app.rs # crates/trusted-server-adapter-spin/src/app.rs
Scans adapter non-test source for direct identity entry points. Uses the lifecycle move has not yet taken into core are listed and must stay in use, so the list only shrinks. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
IdentityApp::build used to fall back to no limit whenever the platform left the limiter out, so an adapter that adds a record store could run batch and pull sync unlimited by omission. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
The old core test compared two reads of the same Arc field and could not fail. The new one seeds the store the platform supplied after mounting and reads it back on two requests, which fails if a request builds its own store. The Fastly sandbox test drops checks implied by its identity app comparison and its expect messages now follow the should convention. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
The request state cloned the identity graph per request but only checked whether it was present, since the entry point takes the graph from the identity app built once. Signed-off-by: dhruv8sh <dhruv8sh@proton.me> # Conflicts: # crates/trusted-server-adapter-fastly/src/app.rs
The identity app kept its own copy of the error-to-response mapping. It now uses trusted_server_core::error::http_error, which every adapter already shares, so admin routes mounted from core answer errors like every other route. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Only the core identity app calls the admin EC and EIDs lookups now, so the compiler enforces that adapters reach them through IdentityApp::mount and the guard test no longer lists them. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
The guard treated every cfg(test) as a whole item, so after a test-only struct field it also dropped the production lines that followed. It now strips comments and literal contents, ends a test-only field or statement at its own nesting depth, keeps scanning code under cfg(any(test, ..)), skips inner cfg(test) files and out-of-line test modules, and matches symbols on identifier boundaries. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Axum ran diagnostics request preparation on every admin lookup and Cloudflare on the EIDs echo, but the routes mounted from core skipped it, so the reserved console query and cookie reached the handlers and a preparation error no longer stopped them. Every adapter now runs it on all three admin routes; on Fastly and Spin this newly strips the reserved query and cookie there. Signed-off-by: dhruv8sh <dhruv8sh@proton.me> # Conflicts: # crates/trusted-server-core/src/ec/app.rs
Prebid treats cookie&html5 as cookie storage plus local storage. SharedID write-back counts it as cookie storage, so the config must accept it and forward it to Prebid unchanged. Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
…cid.org The server read a cookie hard-named sharedId and filed it under sharedid.org. It now reads the cookie named by the storage.name of the sharedId managed User ID entry, keeps reading sharedId when no entry has storage, and reads none when Prebid keeps SharedID in local storage only. The admin EIDs echo on every adapter and the template-cache key deny list use the same name. SharedID is filed under the pubcid.org partner, or under sharedid.org when only that one is configured. A record still holding it under sharedid.org is moved to pubcid.org on its next write, and the stored value wins. Bidders receive it once, as source pubcid.org with atype 1, whether it came from the record, the cookies or the auction body, and a sharedid.org browser EID follows the pubcid.org vendor gate. A _pubcid_optout cookie keeps SharedID out of the record, the ingestion preview and bid requests. Storing and sending it already needed TCF Purposes 1 and 4; tests now cover SharedID for both. Closes #1584 Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Every adapter manifest declared `trusted_server_kv`, but each adapter handed core an unavailable KV store. Cloudflare and Spin also served request-time config from a no-op store, so Spin's documented request-signing metadata in the `default` label was unreachable. - Fastly uses the KV handle EdgeZero registers for the declared store. - Cloudflare opens the `TRUSTED_SERVER_KV` binding per request; request signing stays unsupported there and is documented with its results. - Spin declares only the KV store (label `trusted_server_kv`) and reads request-time config from `default`, the label startup reads. - Axum opens an opt-in file store at `TRUSTED_SERVER_KV_PATH`, running its synchronous I/O on Tokio's blocking pool. - A missing binding never fails startup or routing: KV operations return a typed error. Core gains one shared `KvHandleStore` bridge in place of the adapters' private copies. The guides gain a full store inventory, stale adapter statements are corrected, and dead local fixture stores are removed. Refs #1139
- Axum's runtime KV store now sits behind a KvHandle, so key, value and TTL limits match the other adapters, and it opens during startup instead of on the first request. - The local counter_store KV entry backed nothing: FastlyRateLimiter opens an Edge Rate Limiting counter, which Viceroy stubs. Remove it and correct the inventory. - Add a Spin CI test that signs an auction request with the metadata in `default` and the private key in its encoded component variable. - Correct inventory rows, the Cloudflare guide and a test comment, and link the request-signing guide to the store inventory. Refs #1139
The OpenRTB tests keep this pull request's EID helper imports alongside the base's scripted-client imports for the provider round-trip tests. The base's wire-level auction tests now read EIDs where this pull request writes them. The vendor-denied body EID test and the EC identity denied test in the auction endpoint, and the template cache reader-identity test in the publisher, read user.eids through the shared user_eids and assert_no_user_eids helpers instead of user.ext.eids, since the standard profile no longer writes the extension field. The APS no-EID test drops the transport_timeout_ms field that the base removed from AuctionContext.
The merge applied without conflicts. The Prebid integration config keeps this pull request's mode field next to the base's changes, and the example config, the Prebid guide and the tsjs Prebid sources take both sides unchanged. The server mirror cookie the identity mode reads is the same name and envelope in the base, so no code needed to change.
Core identity app. IdentityApp now carries the provider stack's identity state as well as its own: the partner registry, the page and after-response provider coordinators (#1487, #1489), the EC record store and the rate limiter. IdentityPlatform takes an optional IdentityProviders (the registry the coordinators were built against plus both coordinators); without one the app builds the registry with PartnerRegistry::from_ec and runs no provider, matching the base's non-Fastly adapters. The admin EC lookup awaits the async handler from #1526. Send and Sync. #1526 keeps EcKvStore free of Send and Sync bounds and tests a non-Send store, so the T21 supertrait bounds on EcKvStore and RateLimiter are dropped. The identity app instead holds its record store and rate limiter as Send and Sync trait objects, and IdentityApp::identity_graph hands out a graph over that one shared store through the new KvIdentityGraph::from_shared. IdentityPlatform's identity_graph field becomes record_store accordingly. Fastly app. AppState drops the base's partner_registry, page_identity and after_response_identity fields for the identity app. build_identity_app builds the kind-aware registry and both coordinators from the identity-providers crate, then the app with Fastly's record store and rate limiter. Page lookups and after-response preparation read their coordinators and rate limiter from the identity app; identify, batch sync, auction, page bids and the publisher fallback use its registry and graph. The admin lookups stay mounted by the identity app, so the base's async admin early dispatch is removed. Fastly entry point. finalize_response keeps the base's single block_on around the async EC finalize, which collects the page lookups first. FinalizeInputs keeps the base's AppState, and FinalizeState carries the identity app and the after-response lookups. maybe_identity_graph is gone; the test-only require_identity_graph reads the identity app's graph. Post-delivery. The after-response providers, pull sync included, take the partner registry, graph and rate limiter from the identity app carried in FinalizeState. The base's pull-sync tests build their state through the identity app. Axum, Cloudflare and Spin. The identity app mounts the admin lookups; the base's provider rejection at startup and #1614's local 501 and 405 partner API answers are kept. Tests. The core identity app tests use record stores and the async graph, and two tests cover the carried registry and coordinators. The Fastly identity fixture builds an identity app around its echo-provider coordinator. The adapter identity guard replaces dispatch_pull_sync, which #1489 deleted, with commit_after_response_lookups and also guards PartnerRegistry::from_ec.
…ero d063a8e7 Brings Aram's identity integration chain merge-forward and b181544 (Accept any Fastly EC store link name at startup). EdgeZero moves from tag v0.0.12-rc-identity.202611.1 to rc/identity d063a8e7, which contains that tag (client identities) and the Fastly SDK 0.13.3 upgrade. error-reference.md keeps both the base's wording and this PR's client-identity hint.
Rewriting the auction-providers key and chain in place fails every mtls auction until both writes reach a POP: the chain comes from the Config Store on each request, the key from the Secret Store whenever a backend registers, and the stores propagate independently. Staging measured about three minutes of failures for a key-first rotation. Declare two client identities, auction-providers-blue and auction-providers-green, and select one with [auction] mtls_slot (default blue, omitted from serialized configs). An operator fills the idle slot, waits for it to propagate, then pushes the slot switch; every request reads one complete pair or the other, so no auction pairs a new key with an old chain. - MtlsSlot in the auction plan and AuctionConfig, threaded into compile_client_identity - edgezero.toml declares both identities - Viceroy case: green slot alone bids with mtls_slot = green - Guide, configuration and error references, PBS runbook, example configs and the design spec describe slot rotation
Source: spec/edgezero-pr275-migration at c197404.
…on every adapter Source: feat/identify-batch-sync-local-all-adapters at 9e08a9b.
…n endpoints Source: review/http-auction-provider at 1952dec.
Source: review/shared-async-ec at 5fa4461.
…IDs in a single page-load write Source: feat/s2s-eid-collection-core at 60de896.
…ent, LiveRamp, ConnectID and UID2 Source: feat/s2s-eid-vendors at d3135c3.
…n pull sync as an identity provider Source: feat/s2s-eid-collection-providers at 2765111.
…r for a full row Source: fix/pull-sync-full-row at e0ddbdb.
…sented row was read Source: fix/user-id-requires-row at 83f7701.
Source: feat/openrtb-user-eids at 983baa7.
…cookie and send it once as pubcid.org Source: feat/sharedid-cleanup at 0347d56.
…ntity app Source: feat/identity-app-in-core at 3e7b13b.
…demo baseline Source: baseline/native-aws-20261110 at f94f6f9.
…seline Source: baseline/protected-geo-20261110 at 96e21b0.
…e demo baseline Source: baseline/http-auction-20261110 at b00cd97.
…ble demo baseline Source: baseline/shared-async-ec-20261110 at cd6241c.
…B persistence Source: baseline/native-ec-20261110 at 6b357d5.
…nchronization Source: baseline/sourcepoint-20261110 at 04bad81.
…nd celld Source: baseline/ec-storage-20261110 at b181544.
Source: baseline/native-image-20261110 at 4d2eeae.
Source: baseline/native-runtime-20261110 at 529824a.
…nd durable Edge Cookie storage Source: baseline/aws-examples-20261110 at afc4f5d.
… providers that set mtls Source: feat/1650-auction-provider-mtls at eaa2b3e.
…tegration Source: feat/1594-identity-only-tsjs at 4361233. Needed for the staging config's Prebid mode = "identity".
…isher origin Source: feat/publisher-origin-client-ip at b72119a. Conflict resolution against the native stack, same as the first build: - publisher.rs: the stack builds the origin request with publisher_origin_request instead of rewrite_origin_request. set_origin_client_ip_header runs on the request just before it, after template-cache key capture, as in the PR. - proxy.rs, settings.rs: keep the stack's scripted-client tests. The asset proxy omission test and the publisher origin header test are ported to the scripted client and PublisherUpstream helpers. - configuration.md: keep the stack's Spin note and add the new setting's section. Open review items on #1607 (template-cache ordering P1, domain lint, missing spec) are not addressed here.
ChristianPavilonis
force-pushed
the
rc/pre-ramp
branch
from
November 25, 2026 21:41
77f9b2c to
58a65ab
Compare
17 of 18 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
preramplabel, built for staging onts.autoblog.comand the auction provider mTLS test (Present a client certificate on auction provider OpenRTB requests (mTLS) #1650).main(db36dc0ec): one merge commit per PR, in stack order, each at its current head. Not a merge candidate formain. Review the source PRs, not this branch.d063a8e7(rc/identity), which contains the client-identity work and the Fastly SDK 0.13.3 upgrade, so Upgrade EdgeZero to v0.0.12, Fastly SDK to 0.13.3 and Viceroy to 0.22.0 #1671 is included throughmain.Included PRs
After #1667 the tree is identical to #1667's head tree.
spec/edgezero-pr275-migrationc1974041ffeat/identify-batch-sync-local-all-adapters9e08a9bb2review/http-auction-provider1952dec2freview/shared-async-ec5fa44612afeat/s2s-eid-collection-core60de89610feat/s2s-eid-vendorsd3135c370feat/s2s-eid-collection-providers27651119efix/pull-sync-full-rowe0ddbdbe4fix/user-id-requires-row83f7701c8feat/openrtb-user-eids983baa76dfeat/sharedid-cleanup0347d5652feat/identity-app-in-core3e7b13b89baseline/native-aws-20261110f94f6f9e9baseline/protected-geo-2026111096e21b06abaseline/http-auction-20261110b00cd9784baseline/shared-async-ec-20261110cd6241c42baseline/native-ec-202611106b357d5d6baseline/sourcepoint-2026111004bad8102baseline/ec-storage-20261110b181544a0baseline/native-image-202611104d2eeae09baseline/native-runtime-20261110529824a2ebaseline/aws-examples-20261110afc4f5d61feat/1650-auction-provider-mtlseaa2b3e16feat/1594-identity-only-tsjs43612336afeat/publisher-origin-client-ipb72119a72Changes since the first build
b181544a0: the Fastly adapter accepts any EC store link name at startup again (for exampleec_id_store). The store opens by link name on first EC use, so the declared-logical-ID check no longer guarded anything and failed every route for existing configs.eaa2b3e16: client certificates rotate through two slots,auction-providers-blueandauction-providers-green, selected by[auction] mtls_slot. Filling the idle slot and switching avoids the failure window that an in-place key and chain rewrite causes.Not included
Conflict resolution
Only the #1607 merge needed manual resolution:
publisher.rs: the stack builds the origin request withpublisher_origin_requestinstead ofrewrite_origin_request.set_origin_client_ip_headerruns on the request just before that call, still after template-cache key capture, as in Send the resolved client IP to the publisher origin #1607.proxy.rs,settings.rs: kept the stack's scripted-client tests. Ported Send the resolved client IP to the publisher origin #1607's asset-proxy omission test and publisher origin header test toScriptedHttpClientandPublisherUpstream.docs/guide/configuration.md: kept the stack's Spin note and added theorigin_client_ip_headersection.#1607's open review items are not addressed here: the template-cache ordering P1, the changed-lines domain lint, and the missing spec. Expect the domain-lint job to fail on this PR for that reason.
Local checks at
58a65ab34cargo fmt --all -- --check,cargo clippy-fastly,clippy-axum,clippy-cli: passcargo test-fastlyandscripts/integration-tests.sh fastlyon Viceroy 0.22.0: pass, 31 integration cases including the four mTLS casescargo test-axum, CLI tests,cargo build -p trusted-server-adapter-fastly --release --target wasm32-wasip1: passts config validate --no-envpasses on the staging config, with legacyec_storeand withmtls_slot = "green".Staging plan
staging.ts.autoblog.com. Theauction-providers-blueslot is provisioned.ec_store = "ec_id_store"in the staging config to confirm the startup fix.pbs-test.christianpav.com.