Skip to content

Run Axum identity through the shared application - #1646

Open
prk-Jr wants to merge 41 commits into
feat/providers-awaitedfrom
feat/1574-axum-shared-identity
Open

prk-Jr wants to merge 41 commits into
feat/providers-awaitedfrom
feat/1574-axum-shared-identity

Conversation

@prk-Jr

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

Copy link
Copy Markdown
Collaborator

Summary

  • Run Axum identity through the shared core application and the one EdgeZero record service. Consented document/EC requests persist before issuing ts-ec; partner APIs stay local, and /auction body EIDs update existing live records.
  • Replace obsolete native TS_EC_* selection with a declared logical record store and EdgeZero provider bindings. Preserve prepared config/secret startup. A configured record store that is not prepared, cannot meet the record contract or is unsupported on Axum now installs Finish Axum production startup on the native baseline #1635's failure router (see Startup failures).
  • Run the same expanded T5 navigation and HTTP contract suite on Axum and Fastly, preserving Fastly's platform/delivery bridges while moving lifecycle, partner dispatch and provider/pull-sync decisions into core.
  • Combine with Verify awaited identity lookups and save /auction body EIDs #1642's awaited provider lookups. Where both PRs implemented the same feature, one implementation survives (see Reconciliation with #1642).

Stacked on #1642 (feat/providers-awaited).

Current review-correction head: 54812681516b4d32f9311af151913f32cf724593. Earlier commit-specific verification below is historical; current-source local and hosted qualification are recorded separately.

Startup failures

Since merging #1635, Axum follows the #1142 health and startup-failure contract:

Failure Result
EdgeZero cannot prepare a declared store, including the selected record provider (outage, provider not compiled, missing celld token, no writable EDGEZERO__ADAPTER__DATA_DIR) Non-zero exit before the port opens
Missing or invalid config or secret; invalid runtime settings Process listens: /health 200, /ready and the ordinary methods handled by the adapter 503
Configured EC record store not prepared, record contract or layout mismatch, or EC storage unsupported on Axum (for example provider = "fastly") Same failure router: /health 200, /ready and the ordinary methods handled by the adapter 503

Before this merge, the last row exited before listening.

Reconciliation with #1642

#1642 and this PR both branched from #1641 and both implemented /auction body EID saving, page-phase provider lookups and the identity-cookie rule for non-document responses. Signed merge 4ffbaf805 keeps one implementation of each; signed follow-ups 461aa0d38 and aa315593f add review fixes and restore #1642's write gating for rejected clients. No commit rewrote history.

Feature Survivor Removed
/auction body EID saving This PR's shared endpoint writer (commit_auction_body). It saves before bidding, also when bidding is disabled, and runs on both adapters. #1642's finalize-time writer and commit_auction_ingest. Finalization never saves auction body EIDs.
Page-phase provider lookups Shared core lookup methods, collected by the request handler (#1642's approach). The Fastly thread-local NAVIGATION_LOOKUPS and collection in main.rs. No per-request global state remains.
After-response work Shared orchestration, carrying #1642's request-owned signals. One path for both adapters. Fastly-local dispatch.
Identity cookies on non-document responses This PR's positive-cookie eligibility gate, plus server-generated expiry cookies on any finalized response, as WB-1 allows (S2S design). Blanket stripping of every identity cookie off ineligible responses.

Single write per /auction

auction_and_finalization_make_at_most_one_conditional_write counts conditional writes across the handler and finalization on the same store:

Case Conditional writes
New body UID 1
First write hits a conflict 1 (no second attempt from finalization)
Cookie EIDs only 0
Body UID already stored 0

Putting #1642's finalize writer back makes this test fail (2 writes instead of 1 on conflict). finalize_never_persists_auction_body_eids now loads a live record before finalizing, so it also fails if a finalize writer returns.

Tests carried over from #1642

All of #1642's tests for the removed code moved onto the surviving path. The main ones:

#1642 test Now
auction_body_eids_reach_context_and_kv auction_body_eids_are_persisted_before_response (core auction/endpoints.rs); also checks the row before finalization
finalize_saves_auction_body_eids_to_missing_partner_uids auction_saves_body_eids_to_missing_partner_uids
finalize_auction_body_eids_never_create_a_row auction_body_eids_never_create_a_row
Lookup within / past deadline Fastly app.rs, same names, through the handler
id5_lookup_reaches_the_minted_record_and_the_mirror_of_the_same_navigation Unchanged body, now on the shared path

Seven Fastly lookup and after-response tests are unchanged apart from setup. #1642's navigation_with_fetch_metadata_mints_an_ec became ..._gets_a_permit: without a record store this PR never issues an EC that has no record behind it, so the test now checks the permit instead.

EC route browser contract

The server adopts the browser consent queue contract from #1622. TCF-only and combined requests previously returned 400 because the server expected tcfString and required applicableSections. GPP-only requests also removed unposted TCF consent from the request.

  • Accept optional tcString, gppString and applicableSections; reject unknown fields, including tcfString.
  • Posted fields replace only their matching request cookies. Omitted fields keep euconsent-v2, __gpp or __gpp_sid, as ID-9 requires. An explicit empty sections array clears the sections hint. Supplied fields must be strings or an integer array; null is rejected.
  • Limits: 16 KiB body, effective 4 KiB TCF, 8 KiB GPP, at most 32 section IDs in 1–65535.
  • The complete TCF/GPP string is validated against the cookie-safe alphabet before request cookies are rebuilt.
  • Shared fixture crates/trusted-server-js/lib/test/fixtures/ec-route-contract.json runs through the real Axum and Fastly routes (eight cases).
  • window.__tsjs_prebid.ecRoute injection is in Report CMP consent to the EC route and merge its answer into Prebid #1622 and stays outside this PR.

Changes

Area Change
Core identity app Shared request preparation, generation, partner dispatch, finalization, EC HTTP route, provider lookups and pull-sync orchestration.
Core auction/records Consent-gated body-only EID saving into an existing live record with one conditional write, including when bidding is disabled; no row creation, revival or conflict retry.
Core cookie policy Positive identity cookies only on eligible responses. On ineligible responses, origin identity cookies are removed before finalization; afterwards only server-generated expiries of managed identity cookies survive, with Cache-Control: no-store, private.
Axum Bind the prepared record handle into the shared app; remove the separate graph and always-501 batch path; run follow-up work through EdgeZero's bounded, shutdown-drained task API; cancel page lookups on redirects.
Fastly Delegate identity to core; keep lazy record opening and delivery/platform services; collect page lookups in the handler; keep the browser gate on /auction body saving and on finalize record writes.
Cloudflare/Spin Use the core facade for their local unsupported identity paths; unsupported store configuration is still rejected.
Tests and docs Portable conformance on both adapters, startup and unsupported-store coverage, consent/cookie boundaries, store guidance and runtime environment guards. The edge-cookie guide and both affected designs describe the reconciled behavior.
Build and CI Native-container, test and formatting workflows, core/JS build support and runtime-guard fixtures for the shared app and record-provider checks.

The record service is declared unconditionally. Omitting ec.storage disables application identity, while EdgeZero still prepares the declared provider; the local provider needs a writable data directory. Select DynamoDB/celld through EdgeZero bindings, not TS environment variables.

Identity cookie rules

  • Positive identity cookies (ts-ec, ts-eids, the mirror, SharedID write-back) are set only on eligible HTML document responses, cached-document 304 responses and EC route responses.
  • Expiry cookies on any finalized response. Server-generated expiries for ts-ec, the configured SharedID cookie and its _cst companion, and __Host-ts-eids-mirror may accompany any finalized response. This covers explicit withdrawal, mirror revocation and SharedID opt-out (_pubcid_optout). Other expiries, such as the retired pull marker, are still dropped off ineligible responses.
  • Origin cookies cannot pass as server cookies. On ineligible responses, origin Set-Cookie headers with managed names are removed before core finalization, including origin expiries and values with non-ASCII bytes.
  • Responses carrying an expiry are private: Cache-Control: no-store, private, with validators and shared-cache headers removed.
  • Explicit withdrawal always expires the browser EC on its tombstoning response, regardless of method, status or content type, and also when the tombstone write fails. A failed authoritative withdrawal on the EC route returns 503.
  • Configured Fastly asset-only streaming routes keep their no-identity-lifecycle contract.

Behavior changes

Fastly, compared with #1641

Production comparison base: #1641. The parent design motivates these differences.

Area #1641 This PR Basis
Browser eligibility JA4 class plus recognized UA platform required; absent JA4 or unknown platform blocks identity/provider work. known_browser != Some(false); absent or unrecognized trusted JA4 does not block on its own. ID-7 / DEC-18, SH-5. Full trusted TLS/UA contradiction rules stay with #1581.
Record access for rejected clients Graph hidden from publisher, auction, page-bids and finalization, so a cookie EC reached bidders as user.id without a record check. Finalization wrote only for consent withdrawal. Graph kept on publisher, /auction and page-bids for reads only: a cookie EC reaches bidders as user.id only with a consented record, and stored EIDs enrich bids. Rejected clients get no navigation write permit and no finalize writes (no ts-eids/SharedID ingestion, no SharedID creation or write-back, no EC refresh); /auction body saving is skipped and the EC route GET restores no SharedID. Consent withdrawal still tombstones and expires the EC. Axum behaves the same on all three routes. ID-2, ID-7, SH-5, ID-1.
Non-HTML publisher responses A navigation could finalize identity on non-HTML origin output. Final HTML/XHTML required, except cached-document 304. WB-1, ID-1.
Identity cookies on other responses Finalization could expire mirror/retired-marker cookies on APIs and leave origin identity cookies intact. SharedID expiry required a navigation. Origin identity cookies removed; server-generated EC, SharedID/companion and mirror expiries allowed on any finalized response. SharedID opt-out deletion no longer needs a navigation. WB-1, ID-1.
Cache result of expiry cookies Identity Set-Cookie downgraded the response to private, max-age=0. Expiry responses become no-store, private, without validators. Responses whose only identity cookies were filtered can keep ordinary origin cache policy. WB-1 requires private without shared-cache directives; no-store is stricter.
EC route /_ts/api/v1/ec fell through to the publisher. Local same-origin consent snapshot: POST commits before cookie; GET 204 can restore an existing SharedID without minting; other common methods 405. ID-9, ID-1, WB-1, SH-5.
/auction body EIDs Parsed and forwarded, not saved. One consent/partner/ownership/opt-out-gated conditional update of an existing live row, even when bidding is disabled. No creation, revival or retry. ID-8, ID-2, SH-5.
Split Cookie headers ts-eids captured only from the first Cookie field. First matching ts-eids across all Cookie fields. Approved SH-5 compatibility change.
DataDome with invalid checked origin Raw Host/URI fallback supplied Host, ServerHostname and Protocol. Those unchecked fields are omitted. Inherited from #1635's checked-ingress contract.

Compared with #1642

For reviewers who reviewed #1642:

Fastly Axum
/auction body EIDs Saved in the endpoint before bidding, including when bidding is disabled (#1642 skipped saving when bidding was disabled). Same shared writer.
Page lookups Same handler-owned collection, now through shared core methods. Gains the shared lifecycle, EC route, providers and drained follow-up work.
Redirects Pending lookups cancelled (as in #1642). New: pending lookups cancelled without waiting.
Cookies SharedID opt-out deletions added on API responses; expiry responses become no-store, private. Mirror revocation and SharedID opt-out expiries on non-document APIs.

Stack and merge notes

Verification

Current-source qualification for 54812681516b4d32f9311af151913f32cf724593 (tree 6fecd437c3e279194fb2a1ec891855c14813fc2e, SDK ef5cbf30878e0c6cdb8c706117c02add75493531):

  • Required Rust tests and target-matched lints, native build-digest/AWS example checks, full CLI/browser fixtures, parity, format/docs/JS lint/build, actual-base domain lint, runtime environment guard and 58 Linux ARM compiler fixtures pass. Full JS: 83 files / 3,379 tests, no type errors.
  • Current normal production builds and startup/failure smokes pass on Fastly, Axum, Cloudflare and Spin. Three deadline runtime suites, both actual worker-store suites, Fastly identity/proxy checks, both Geo feature suites, Axum/Fastly HTML EOF auction controls and all three template-cache modes pass.
  • Both unchanged canonical Dockerfile jobs pass on Linux ARM64: local-provider image and aws-dynamodb-ec,geo-cloudfront record image against pinned DynamoDB Local. Actual app image runs retain PID 1 behavior. Image version metadata identifies the qualified candidate tree; the signed commit has that same tree. These are synthetic local services, not live AWS/IAM or deployed-wrapper qualification.
  • Broken controls, each restored: a broad second header pass fails actual Fastly precedence; a separate marker reintroduces the filtered cookie; omitting PUT sends both adapters to a forgiving publisher instead of the required 405.
  • One extra AWS-feature run initially failed to bind a fixture port. The exact unchanged full command passed on recheck; the port holder was not identified. Assertions, timeouts and test parallelism were unchanged.

Pinned local tools include Rust 1.98.1, Node 24.20.0 and this branch's Viceroy 0.22.0. Hosted CI is pending on this new commit; prior SDK/head results below are historical. Exact new-head stock-celld, full browser/integration and hosted platform qualification remain separate obligations. No thread is resolved from earlier-head CI.

Historical verification

These results name earlier revisions and do not qualify the new correction head or its updated SDK.

Author-run local results on the merge result (000e6f694):

  • cargo test-axum (122 passed), including unsupported_ec_storage_serves_the_failure_router_and_uncompiled_providers_fail_before_listen, missing_secret_serves_the_failure_router_without_legacy_fallback, identity_conformance_axum and redirect_cancels_page_lookups_without_waiting.
  • Isolated Viceroy 0.21.0 Fastly adapter tests (254 passed), including the after-response lookup tests and proxy_policy_named_route_preserves_withdrawal_and_terminal_privacy.
  • Native core ec::app and health tests (28 passed); CLI config_env_overlay (20 passed); scripts/test-runtime-env.sh (54 fixtures) and scripts/lint-runtime-env.sh.
  • cargo check-axum, check-fastly, check-cloudflare, native Spin check; cargo clippy-axum, clippy-fastly, clippy-spin-native; Rust formatting.
  • Hosted checks on 000e6f694.

Author-run local results on aa315593f:

  • cargo test-axum (121 passed), including known_non_browser_navigation_axum, api_identity_expiries_axum, identity_conformance_axum and redirect_cancels_page_lookups_without_waiting.
  • Native core library (3,792 passed), including refused_client_auction_validates_its_ec_without_writing, refused_creation_gets_no_navigation_write_authority and refused_creation_writes_only_a_consent_withdrawal.
  • Isolated Viceroy 0.21.0 cargo test-fastly (4,239 aggregate passes, including 247 adapter tests) and cargo test-fastly-reuse (247 passed).
  • Shared conformance verify_known_non_browser_navigation on both adapters: a known non-browser returning with a live EC and a ts-eids cookie makes no record write and gets no SharedID cookie; the same request from an allowed client writes and gets SharedID; the EC route GET restores the stored SharedID only for the allowed client; the non-browser's consent withdrawal still tombstones the record and expires the EC.
  • auction_body_ingest_rejects_known_non_browsers (Fastly, real routed /auction): non-browsers make zero writes but still have their EC checked against the record (consented row allowed as user.id; missing and withdrawn rows not); the browser control makes one write.
  • Mutation controls, each reverted: restoring the Fastly /auction graph filter fails the auction test; forcing Fastly finalize writes on fails identity_writes_are_refused_only_for_known_non_browsers; removing both new gates on Axum fails known_non_browser_navigation_axum; setting persist_body: true fails the core refused-client auction test; removing the EC route GET check fails known_non_browser_navigation_axum.
  • cargo clippy-fastly, clippy-axum, clippy-cloudflare, clippy-cloudflare-wasm, clippy-spin-native, clippy-spin-wasm; Rust formatting.
  • Hosted checks on aa315593f (superseded by the merge head).

Earlier evidence recorded in this description's edit history is historical and does not qualify the new head:

  • Fastly runtime comparison with production WASM, Viceroy 0.21.0 and real Chrome: positive mints, cached-HTML 304 and withdrawal on POST/404/503/SVG/304. Stock Viceroy has no trusted JA4, so a positive Move the lazily opened EC record store into core #1641 mint comparison remains blocked.
  • Axum production binary against DynamoDB Local: record-before-cookie, rejected writes, local partner APIs, and SIGTERM drain during a paused record write.

Remaining qualification

Closes

Closes #1574

Spec

Axum shared identity design and implementation plan; S2S EID collection design for the WB-1 cookie rule.

Checklist

  • Spec linked
  • Production errors use error-stack
  • New behavior has discriminating tests
  • No operator configuration, credentials or private runtime artifacts committed
  • Signed commits; no rebase or force-push; no changes to dependency branches

Review corrections

Earlier accepted corrections remain: all-field SharedID opt-outs; failed auction snapshots discarded after conditional conflicts; external headers settled before identity eligibility and managed-cookie filtering; strict posted GPP payload validation; Fastly EC POST handed to committed delivery; overlapped status dispatch cancelled on redirects.

The new correction preserves Fastly integration-filter precedence when EC state exists. Shared identity finalization settles only operator content type and cookies; ordinary overrides stay at each adapter's existing stage. Both passes share the one-time marker so a later full pass cannot restore a managed cookie filtered out by identity policy. Actual Fastly finalization covers the overlap with and without EC state; an actual Axum route checks cookie provenance through both passes. Restoring the broad pass reproduces the Fastly failure; separating the marker reproduces cookie reinsertion.

Core and Fastly now share one catalog of nine standard EC-route methods, retaining their distinct after-response handoffs. Actual Axum/Fastly requests check all seven unsupported standard methods return 405 with Allow GET/POST without publisher traffic. Removing PUT makes both tests fail through a forgiving publisher; Fastly EC POST retains committed delivery rather than the generic queue.

The request lifecycle reuses the all-field cookie reader; its regression runs through IdentityApp.read_request. The separate Cookie::split_parse behavior remains. Removed unused terminal-response plumbing, aligned its privacy tests with production ordering, and removed an overwritten ID5 fixture from the LiveRamp cancellation test.

Guard comments/designs now describe native workspace-dependency lint coverage and required local verification. The earlier native-only forbidden-read control showed the existing guard already rejects that provider dependency; no additional primary-package flag was needed. The inherited Unicode-only Geo path requirement remains the accepted #1637 contract: even a readable non-Unicode Unix path is unavailable and its presence prevents silent KV fallback.

The maintainer's b06dcbd merge and SDK ef5cbf30878e0c6cdb8c706117c02add75493531 are preserved, including the new BOOT diagnostics, startup-router consolidation and readable Geo test helper. No SDK edits, dependency-branch merges/rebases or deployment were performed by this correction. Dependent PRs require their own combined-source qualification after integrating these changes.

@prk-Jr prk-Jr self-assigned this Nov 20, 2026
@prk-Jr prk-Jr linked an issue Nov 20, 2026 that may be closed by this pull request
8 tasks
Accept tcString, preserve consent cookies for omitted fields, and validate optional section IDs. Exercise the browser request shapes through both adapter routes using a shared fixture. Reject cookie delimiters before reconstructing posted consent cookies.
Keep EC GET read-only while withholding SharedID cookies under GPC, US Privacy opt-out or unknown geography. Exercise the permission boundary and decisive GPP consent through both adapter routers, and correct the related architecture and auction diagrams.
PR #1642's new head brings the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536, #1535, #1537 and #1538.

crates/trusted-server-adapter-axum/src/native_geo.rs: #1646 resolves KV Geo selection through AxumRunOptions and reads the profile path with runtime_env!'s os form, while #1532 named the EdgeZero provider variable and #1637 now reports a non-Unicode profile path as unavailable, with Linux tests. The resolution keeps #1646's AxumRunOptions selection and #1637's Unicode-only profile read, so a valid profile at a non-Unicode path no longer loads, as #1637 documents. EDGEZERO_GEO_PROVIDER_ENV becomes test-only. #1532's and #1637's KV selection tests now set a complete EdgeZero KV Geo selection, because #1646 requires every KV field rather than only the provider. The test imports keep OsStrExt for the Linux tests and OsString for #1646's Unix test.

crates/trusted-server-adapter-axum/src/app.rs: #1535 advertises the identity graph on the integration registry once native persistence binds, and replaced the local cookie reader in the native EC request path that #1646 moved into the shared identity app. The resolution keeps #1646's shared app and record-store binding and adds #1535's registry update after it.

crates/trusted-server-adapter-fastly/src/app.rs: #1535 made the Fastly consent update acknowledge by store availability without the bot gate, and #1646 routes identify and consent update through the shared identity app, whose consent_update already does that. The resolution keeps #1646's delegation.

crates/trusted-server-adapter-axum/src/record_ec.rs: #1537 added the UNPREPARED_STORE message constant above declared(), which #1646 removed. The resolution keeps the constant, which acquire uses, without declared().

crates/trusted-server-adapter-axum/tests/native_ec.rs: #1536 and #1646 each added router_with_settings with different argument orders. The resolution keeps #1536's order (settings, store, geo) and moves #1646's one call to it.

AGENTS.md: the resolution keeps the base's gate list 17 to 21 with #1646's wording for the runtime environment guard, which no longer lists the EdgeZero Geo provider exception that #1646 removed from runtime_env!.

docs/guide/axum-dev.md, docs/guide/edge-cookies.md, docs/guide/integrations/sourcepoint.md and docs/guide/native-ec-persistence.md: the resolution keeps #1646's rewritten sentences together with the base's additions: #1531's JWKS snapshot sentence, #1639's pull-sync room wording, #1535's syncConsent paragraph and its no-record-store paragraph.

@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 the three commits since my last review (6b4a5fdc0..39392fc85). As discussed, I only looked at the new commits, not the full PR again.

All six items from my last review are addressed. The fix for prior R3 (operator headers settling before cookie eligibility) has a side effect on Fastly request-filter precedence; that's R1 inline.

Approving so I'm not blocking, on the understanding that you'll handle the inline comments before merging.

use_store: bool,
response: &mut Response,
) {
apply_response_headers_with_cache_privacy(&self.settings, response);

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 · P3: this second operator-header pass now overrides request-filter effects on Fastly. On Fastly, apply_finalize_headers runs the first pass (main.rs:547), request-filter effects are applied (main.rs:554-556), then EC finalize runs this call. The marker only stops Content-Type and Set-Cookie from being re-applied (response_privacy.rs:212-222); every other configured operator header is inserted again over whatever a request filter just set (DataDome's X-DataDome-headers, for example). Before this delta Fastly applied filter effects last. Now operator-vs-filter precedence on Fastly depends on whether the route carries identity state; Axum is unchanged.

Suggest applying only what must settle before eligibility here (Content-Type, Set-Cookie), for example a narrow apply_operator_representation_headers, and leaving the rest to each adapter's pass. That also removes the dependency on which caller runs first. If operator-over-filter is the intended precedence, say so and apply it the same way on Fastly's non-EC paths. I traced this in the code only; no test overlaps an operator header with a filter effect.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 548126815. The shared identity pass now settles only operator Content-Type and Set-Cookie, leaving ordinary overrides to the adapter stage. It shares the existing one-time marker with the full pass, preserving managed-cookie provenance. Actual Fastly finalization with/without EC state now preserves the filter header; the routed Axum test retains ordinary operator cookies while removing managed identity cookies. Restoring the broad pass reproduces the Fastly failure; removing the shared marker reproduces cookie reinsertion.

Fresh target-matched Rust/JS gates and the selected real runtime suites pass on this exact source tree with SDK ef5cbf30. Current-head CI has started and remains pending; I am leaving this thread open until the required checks are confirmed.

// lookups. Their other methods reach the catch-all fallback, which
// denies admin diagnostics locally.
router = state.identity.mount(router);
for method in [

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: Fastly copies core's EC-route method table. This repeats the nine-method loop from IdentityApp::mount_ec_route (core/src/ec/app/route.rs:68) to add the delivery handoff, while the other adapters still use the core version. If the two lists drift, Fastly requests for the missing method fall through to the publisher, which is the bug the EC-route contract fixed. Letting mount_ec_route (or a mount_ec_route_with) take the finalized handoff closure would let this copy go.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 548126815. Both route registrations now use EC_ROUTE_METHODS. This removes the drifting nine-method lists while retaining core request-owned scheduling and Fastly committed delivery. Actual Axum and Fastly requests cover HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE and CONNECT: 405, Allow GET/POST and no publisher request. A removed-PUT control makes both tests fail with publisher 200; EC POST still uses committed delivery and leaves the generic queue empty.

Fresh target-matched Rust/JS gates and the selected real runtime suites pass on this exact source tree with SDK ef5cbf30. Current-head CI has started and remains pending; I am leaving this thread open until the required checks are confirmed.

}

/// Returns the first named cookie value across every request Cookie field.
pub(crate) fn cookie_value_all_fields<'a, B>(req: &'a Request<B>, name: &str) -> Option<&'a str> {

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 · Nonblocking: cookie_value_all_fields is the same hand-split as the private cookie_value in ec/app/lifecycle.rs:392-402, and ec/mod.rs:213 find_cookie_in_any_field parses with Cookie::split_parse and treats quoted or malformed pairs differently. At least replace lifecycle's copy with cookie_value_all_fields(..).map(str::to_owned); folding in the third can wait.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 548126815. read_request now uses cookie_value_all_fields(...).map(str::to_owned); its regression invokes IdentityApp.read_request and verifies the first matching ts-eids in a later Cookie field. The Cookie::split_parse path retains its distinct quoting/malformed-input semantics.

Fresh target-matched Rust/JS gates and the selected real runtime suites pass on this exact source tree with SDK ef5cbf30. Current-head CI has started and remains pending; I am leaving this thread open until the required checks are confirmed.

});

apply_terminal_response_effects(response, request_filter_effects.as_ref());
apply_terminal_response_effects(response, None);

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.

R4 · Nonblocking: production now always passes None here, and only tests pass Some(&effects) (late_filter_effects_cannot_make_an_assembled_response_public, ..._page_bids_response_public, and the diagnostics case). Those tests check an ordering production no longer uses. I'd drop the parameter and have the tests apply the effects first or go through finalize_response.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 548126815. apply_terminal_response_effects now takes only the response. The three affected tests apply request-filter effects first, following production ordering; their assembled/page-bids/diagnostic privacy checks still pass. The actual finalize_response overlap regression additionally covers the production caller.

Fresh target-matched Rust/JS gates and the selected real runtime suites pass on this exact source tree with SDK ef5cbf30. Current-head CI has started and remains pending; I am leaving this thread open until the required checks are confirmed.

ORIGIN,
ScriptedReply::status(StatusCode::FOUND).header("content-type", "text/html"),
);
client.respond_to(Method::POST, "https://id5.example.com/gs/v2/1234.json",

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.

R5 · Nit: the scripted ID5 reply here and the ID5 provider/partner setup at 409-413 are overwritten by the LiveRamp config at 420-429, so the test reads as if two providers race when only one runs. Drop the unused ID5 setup and wrap the long respond_to(...)/json! lines, which rustfmt can't wrap.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 548126815. The redirect/status cancellation test now configures only the LiveRamp provider it exercises, with wrapped fixture JSON. Its real status/origin work, expected two requests and redirect cancellation assertions remain and pass.

Fresh target-matched Rust/JS gates and the selected real runtime suites pass on this exact source tree with SDK ef5cbf30. Current-head CI has started and remains pending; I am leaving this thread open until the required checks are confirmed.

PR #1642'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.
@aram356

aram356 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Round 12 identity realignment: rc/identity is now at db7dce634, and EdgeZero is pinned to its rc/identity at 8a73c097. This branch fast-forwarded from 39392fc85 to 05943361e:

Please check: the merge keeps #1637's Unicode-only Geo profile path read with this PR's AxumRunOptions selection, so a valid Geo profile at a non-Unicode path no longer loads. The KV Geo tests from #1532 and #1637 now set a complete EdgeZero KV selection, because kv_selected resolves through AxumRunOptions.

Each merge message says what it carries and how any conflict was resolved.

PR #1642'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 #1642's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
aram356 added a commit that referenced this pull request Dec 2, 2026
PR #1646's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
aram356 added a commit that referenced this pull request Dec 2, 2026
PR #1646's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
PR #1642'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.

crates/trusted-server-adapter-axum/src/app.rs: #1617's owner commit replaced startup_unavailable_response with the shared startup_unavailable_router in the health import, and #1646 removed the is_navigation_request import next to it. The resolution keeps #1617's import and drops is_navigation_request as #1646 did.

crates/trusted-server-adapter-axum/src/native_geo.rs: #1637's owner commit added the shared readable non-Unicode Geo fixture and its Path imports, and #1646 added the OsStringExt import and selects the native KV variables in the Linux Geo-KV test. The resolution keeps both imports, uses #1637's fixture in that test and keeps #1646's variable selection.

crates/trusted-server-integration-tests/README.md: #1613's owner commit updated the Viceroy wording in the Fastly conformance paragraph, which #1646 replaced with its Fastly and Axum description. The resolution keeps #1646's text.

docs/guide/axum-dev.md: #1617's owner commit and #1627's owner commit edited the startup and Geo-KV notes that #1646 rewrote around the adapter-support matrix. The resolution keeps #1646's text, which already carries the base's matrix links and Geo-KV lookup note.

docs/guide/edgezero.md: #1506's repin, #1616's certificate policy text and #1627's KV note changed lines that #1646 rewrote. The resolution keeps #1646's text with the ef5cbf30 pin, the certificate policy paragraph and the ez_b31v2_ backend prefix.

docs/guide/getting-started.md: #1635's owner commit added the native Geo boot input and the Geo note to the Axum capabilities callout, which #1646 rewrote for the prepared record service. The resolution keeps #1646's record service sentence followed by the base's Geo note and the remaining unavailable operations.

docs/guide/integrations/sourcepoint.md: #1535's owner commits added the skipped unchanged mirror post and the kept mirror during not-ready states, and #1646 added the backing tombstone and EC expiry on the reconciliation response. The resolution keeps the base's paragraph with #1646's additions.

crates/trusted-server-adapter-axum/tests/startup.rs: #1635's owner commit renamed ServerFixture::assert_logs_hold_no_secrets to stop_and_assert_no_secret_logs, and #1646's three new startup tests call the old name. The resolution calls the new name; each call ends its fixture's use.

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.
@aram356
aram356 removed this pull request from stack #1665 December 3, 2026 11:34
aram356 added a commit that referenced this pull request Dec 3, 2026
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.
@aram356
aram356 added this pull request to stack #1731 December 3, 2026 11:35
aram356 added a commit that referenced this pull request Dec 3, 2026
PR #1675's new head brings #1675's switches that turn off POST /auction while the auction is disabled and the first-party creative endpoints while creative rewriting is off, together with the identity chain between #1646 and #1675 that #1667 did not carry yet: #1636's Axum after-response drain on SIGTERM, #1626's provider opt-outs and legacy EID expiry on Fastly and Axum, #1656's configurable Edge Cookie browser gate, #1661's refusal of EC creation when a trusted JA4 contradicts the User-Agent, and #1662's Fastly EC route acceptance and capped mirrored expiry.

docs/guide/configuration.md: #1675 reworded the enabled row of the [auction] table to say that it also turns on POST /auction, and #1667 added the mtls_slot row, which widened the table. The resolution keeps #1675's enabled text and #1667's mtls_slot row, with the table reformatted by Prettier.

Semantic break in crates/trusted-server-core/src/integrations/prebid.rs: #1675's owner commit d141923 added a test plan with no browser routes, whose ProviderConfig and AuctionPlanConfig literals predate #1667's 0985d67, which added the mtls provider field, and eaa2b3e, which added the mtls_slot plan field. The merge applies cleanly but the core tests no longer compile. The fix belongs in this link because it is where the two changes first meet. The literal gains mtls: false and mtls_slot: Default::default(), as #1667 wrote in the neighboring prebid.rs literals.

Cargo.lock is unchanged.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 15 identity realignment: rc/identity is now at 391a08578, and EdgeZero is pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 0070304f9 to b06dcbd0e:

Each merge message says what it carries and how any conflict was resolved.

@prk-Jr

prk-Jr commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

Checked the round-12 Geo merge note against 548126815 and the explicitly accepted #1637 contract. A supplied profile path must be Unicode; even a readable non-Unicode Unix pathname is rejected as unavailable. Its presence still prevents silent KV fallback. That compatibility constraint remains documented in native-rc-demo and the guard design; this correction does not restore OS-string loading or change AxumRunOptions selection. Current local Geo feature suites pass; this keeps the reviewed path contract. Linux-specific and full hosted qualification on the new commit remain part of its pending CI.

Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Cascade of #1533's Axum startup-test port fix (779e44673): 12782e9d7 merges it into this PR. There were no conflicts and nothing else changed. The fix moves free_loopback_port in crates/trusted-server-adapter-axum/tests/routes.rs below the ephemeral port range, and #1533's note has the details. Owner commits pushed to other chain PRs since round 15 come in with the next round. rc/identity is now 62f8e41e2.

@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Merged #1627's runtime KV removal (7c2b84f45) into this branch as 3da6c4f32, on top of 12782e9d7.

At the maintainer's request, that commit removes the generic runtime KV store trusted_server_runtime_kv. Nothing reads or writes it, and the managed Fastly deploy made every service provision and pay for it. edgezero.toml and the Fastly Hooks::stores() now declare only trusted_server_kv, and RuntimeServices::kv_store() is unavailable on every adapter.

Only that commit was merged, not the base branch's new head. Conflicts were resolved in edgezero.toml, the Fastly Hooks::stores() in app.rs, fastly.toml, the Viceroy template, the integration tests' config.rs, trusted-server.example.toml, docs/guide/architecture.md and docs/guide/edgezero.md. Only trusted_server_kv stays declared, this branch's record-store comment and local seeds are kept, and the runtime-KV lines are dropped. The Axum README and docs/guide/axum-dev.md keep this branch's Axum wording.

Checks on this head: no reference to the removed store remains and cargo fmt --check passes; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. rc/identity (b9dc3153e) passed the full CI gate list with the removal.

PR #1642's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in. The merge is clean.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 17 identity realignment: rc/identity is now at 0ed862633, and EdgeZero stays pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 3da6c4f32 to 9263e3275:

Each merge message says what it carries and how any conflict was resolved.

@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as 72cc0ad35, on top of 9263e3275.

Trusted Server owns the /_ts/ namespace (#1740). A request for /_ts or any /_ts/ path that no route handles now gets a local 404 on Fastly, Axum, Cloudflare and Spin, and never reaches the publisher origin. The path is matched after percent-decoding. Paths outside the namespace, such as /_tsx or /articles/_ts/x, still go to the publisher origin, and every routed /_ts/ path answers as before.

This merge takes #1642's new head (31231d439), which carries 48930c270 and nothing else new to this branch. It was clean.

Checks on this head: no conflict markers; cargo fmt --all -- --check passes; the merge adds exactly #1614's change to this branch's files; it merges cleanly with every lower head in its stack. rc/identity (e72407155) passed the full CI gate list with the change.

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.

Identity on Axum through T21's shared app

4 participants