Skip to content

Finish Axum production startup on the native baseline - #1635

Open
prk-Jr wants to merge 10 commits into
docs/1233-proxy-disclosure-policyfrom
feat/1573-axum-production-serving
Open

prk-Jr wants to merge 10 commits into
docs/1233-proxy-disclosure-policyfrom
feat/1573-axum-production-serving

Conversation

@prk-Jr

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

Copy link
Copy Markdown
Collaborator

Summary

Trial merges at the current heads conflict with sibling #1622 and #1626 (files include Axum startup, app and tests, Fastly app.rs/main.rs, Spin app.rs and Axum docs). #1617's newest commit 6d174a883 is not yet merged up the chain and conflicts with this branch in docs/guide/architecture.md. Individual PR checks do not qualify the combined tree.

Changes

File Change
crates/trusted-server-adapter-axum/src/startup.rs Missing/unreadable secret diagnostics name the config field paths, never the key or value. NativeStoreSnapshot is pub(crate). read_only_config/read_only_secret merged into read_only_snapshot (see note below)
crates/trusted-server-adapter-axum/src/app.rs 501 messages and comments say "Axum adapter", not "dev server"
crates/trusted-server-adapter-axum/Cargo.toml Description covers production
crates/trusted-server-adapter-axum/tests/startup.rs Before-listen probe ignores Linux self-connections; missing-config test asserts required snapshot missing with every legacy name poisoned by a valid envelope; distinctive short passphrase; secret-in-logs check after successful runs; rename to ..._while_running; reserve_port comments; should-messages
crates/trusted-server-adapter-axum/tests/native_acceptance.rs Per-key missing-secret assertions; truncated-POST test asserts exactly three /action requests; distinctive short passphrase and success-path log checks; reserve_port comments; should-messages
crates/trusted-server-core/src/secret_resolution.rs, crates/trusted-server-core/src/config_payload.rs New secret_reference_paths / required_secret_references: each required key with the config paths that reference it, for diagnostics. Unit test
crates/trusted-server-core/src/integrations/datadome/protection.rs When checked request info fails, the protection payload omits Host/Protocol instead of falling back to the raw header or URI target. New red/green test
crates/trusted-server-integration-tests/tests/environments/axum.rs Attaches a bounded stdout+stderr tail when Axum exits before readiness or misses the readiness deadline
scripts/test-native-providers.mjs import.meta.main (works through a symlink); agent: false; self-connect guard; failure launches capture output in memory and assert the cause and absence of secret values without printing; --dns 127.0.0.1; DOCKER_HOST pass-through
scripts/tests/test-native-providers.test.mjs Unit tests for the new helpers
scripts/smoke-axum.sh Per-secret missing cases assert the config path and that no reference key is printed
.github/workflows/format.yml, AGENTS.md New CI job runs node --test 'scripts/tests/*.test.mjs'; gate list entry
docs/guide/getting-started.md Axum Option B rewritten for ts config push --adapter axum --local, EDGEZERO__ADAPTER__CONFIG_DIR and EDGEZERO__SECRETS__*; legacy env table removed
docs/guide/native-rc-demo.md, docs/guide/axum-dev.md, docs/guide/api-reference.md, docs/guide/architecture.md, crates/trusted-server-adapter-axum/README.md, docs/.vitepress/config.mts Operator-facing native startup guide with a run-locally block and sidebar entry; Axum described as a production entry point
docs/superpowers/specs/2026-11-19-axum-production-serving-design.md, docs/superpowers/plans/2026-11-19-axum-production-serving.md Design and plan

Acceptance status (#1573)

Item Status
AX-1: missing secret exits before the port opens Done, CI test
AX-1: SIGTERM drains in-flight requests within the grace Done, CI test
AX-1: pending record write completes on SIGTERM Not in A1. Axum saves no Edge Cookie records yet, because Trusted Server's record code calls Fastly KV directly (ec_kv). The pinned EdgeZero (rc/identity 9d02d7b3) already has the record operations for Axum (record_insert, record_exists_strong, partitioned listing; DynamoDB and celld providers), so no EdgeZero work is needed. Remaining Trusted Server work: #1587 (T6, one record backend over EdgeZero KvStore), then #1574 (A2, enable it on Axum), then #1579 (A8, CI test against DynamoDB Local). The SIGTERM drain of after-response work is A3 (#1575, PR #1636). Maintainers: please narrow this checklist item in #1573
AX-2: provider startup through the edgezero#414 AWS providers scripts/test-native-providers.mjs passes locally against moto and the AppConfig agent (Docker). CI runs only its helper unit tests
AX-2: no runtime reads of TS_*, TRUSTED_SERVER_CONFIG_*, TRUSTED_SERVER_SECRET_* Done. Remaining occurrences are poison inputs in tests and scripts; TS_GIT_VERSION is a build-time constant
AX-2: TRUSTED_SERVER__ overrides Applied by ts config push, never read at runtime. The CI guard is A9 (#1580)
AX-7: EdgeZero pin Lockfile resolves EdgeZero to rc/identity 9d02d7b3

#1531 review threads

  • Fixed here: before-listen probe ignores self-connections (thread 10); provider script runs through a symlink via import.meta.main (thread 11); missing-config test asserts the exact diagnostic and poisons every legacy name with valid values (thread 12); truncated-POST test asserts exactly three /action requests (thread 20); native guide rewritten for operators, sidebar entry, run-locally block (thread 23); agent: false (thread 27); DataDome omits Host/Protocol when checked request info fails, on all adapters, instead of reporting the unchecked raw Host or request target (thread 32; the thread offered rejecting or omitting, and omitting keeps the protection request); reserve_port comments (thread 33); getting-started quickstart rewritten (it previously failed; D-2); CI job for the provider helper tests and AGENTS.md gate entry (A-7); distinctive short passphrase and secret-in-logs checks after successful runs (A-10); failure launches assert the cause without printing output (A-12); --dns 127.0.0.1 and DOCKER_HOST pass-through (A-13; DOCKER_CONTEXT is intentionally not passed because HOME is isolated); rename to ..._while_running (A-14); NativeStoreSnapshot is pub(crate) (A-18); should-messages on touched assertions (A-21); integration environment attaches a bounded output tail on pre-readiness exit (A-23); missing-secret diagnostics name the secret's config path, asserted per secret in Rust tests and smoke-axum.sh, with no reference key printed (derived from thread 8; naming the key itself could print a secret pasted into a reference field).
  • Not done: removing temp-env (A-9). The chain restored it, and the native_geo.rs and main.rs tests use it.
  • Declined: a 501 for discovery (A-16). Cloudflare and Spin also return 500 without a JWKS, and discovery_route_status_parity requires Axum to match. Native startup already rejects request_signing.enabled.
  • Already fixed or obsolete after the chain merge: 25 of 33 inline threads and 18 review-body points. Examples: the TS outbound bridge (send_async, eager dispatch, budget tests, proxy marker) is gone and outbound goes through EdgeZero's HttpClient; Spin startup.rs and the Fastly delivery_tests.rs are gone; oversized bodies map to 413 in core; the EdgeZero pin is a rev, not a tag; SIGTERM drain is already covered by production_sigterm_drains_the_admitted_publisher_response.
  • EdgeZero side: pre-dispatch and head-limit (414/431) finalization (A-27).
  • Out of scope: RustSec advisories (rustls, ctutils) are present on the stack base (A-26).
  • Local-only checks (A-8, A-28): see the test plan. The ignored real Next.js test was not run.

Note: read_only_config/read_only_secret were merged into read_only_snapshot because CodeQL flagged the old helper name as a cleartext-logging source on #1528 (rust/cleartext-logging, rotation rollback log). CodeQL only runs on PRs to main, so this PR cannot show the alert gone.

Self-review

An independent review of the implementation found no blocking issues. Its three optional findings are fixed in 6949eea86: name config paths instead of reference keys in the missing-secret error, update the Axum section of the architecture guide, and attach the output tail on the integration readiness deadline.

Closes

Part of #1573. Not Closes: #1531 carries most of A1, and the pending-record-write item needs the shared record backend (#1587), Axum record storage (A2, #1574) and its CI test (A8, #1579). The SIGTERM drain of after-response work is A3 (#1575, PR #1636).

Spec

Spec: docs/superpowers/specs/2026-11-19-axum-production-serving-design.md (ends with a three-round review log)

Test plan

Historical results (execution head unrecorded) (before self-review fix 6949eea86): the following local gates and runtime observations are retained as reported historical evidence; their execution SHA and private receipts are not recoverable. Current hosted CI is separate (31 checks pass on head 06b40446e).

  • cargo test-fastly && cargo test-axum (also test-fastly-reuse with Viceroy 0.21.0, test-cloudflare, test-spin)
  • cargo clippy-fastly && cargo clippy-axum (also clippy-cloudflare, clippy-cloudflare-wasm, clippy-spin-native, clippy-spin-wasm, clippy-cli, clippy-codegen, and the template_build_digest clippy)
  • cargo fmt --all -- --check
  • JS tests: cd crates/trusted-server-js/lib && npx vitest run
  • JS format: cd crates/trusted-server-js/lib && npm run format
  • Docs format: cd docs && npm run format
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve
  • Other: parity test; template_build_digest test
  • Other (targeted): core DataDome and secret-resolution tests (new tests); Axum startup and native_acceptance tests; integration-tests clippy; node --test 'scripts/tests/*.test.mjs' (7 pass); ./scripts/smoke-axum.sh
  • Other (providers): scripts/test-native-providers.mjs against a release binary with both AWS features, moto and the AppConfig agent; every PASS line, including the selected config and secret failures before listen
  • Other (runtime): local Axum production binary behind the publisher dev proxy with real Chrome. Publisher page served 200 with both TSJS bundles injected and executing. A missing secret on real operator inputs exits 1 without opening the port and names the config path, with no key or value in the output (control: Extract native prepared startup on the demo baseline #1531's head gives the generic message); a valid legacy-named value is present but ignored; no secret values in output. SIGTERM during an in-flight 1.4 MB page request completed it, refused new connections and exited 0 within a 5 s grace. The getting-started Option B commands, run verbatim, start the server. Image 404s seen with that local publisher config are identical on Extract native prepared startup on the demo baseline #1531's head (preexisting)
  • Not run locally: wasm clock lint, domain lint, other script gates; the ignored real Next.js test (needs the external fixture)

Checklist

  • Feature PRs: spec linked above, ending in a review log of two or more agent review rounds
  • Changes follow AGENTS.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses log macros (not println!)
  • New code has tests
  • No secrets or credentials committed

Startup errors for an absent or unreadable app-config secret now name the
reference key, never its value. The startup tests poison every legacy name
with valid values, ignore Linux self-connections in the before-listen probe
and check logs for secret values after successful runs too.

DataDome leaves Host and Protocol out of the protection payload when the
checked request information fails, instead of reporting an unchecked header
or request target.

The provider acceptance script runs through a symlink, asserts the cause of
each startup failure without printing output, and pins container DNS.
The getting-started Axum quickstart exported legacy config and secret
variables that the production startup ignores, so following it failed. It now
uses the local config directory and EDGEZERO__SECRETS__ values. The Axum
guides describe the binary as the production entry point, and the native
startup guide is written for operators with a run-locally example.

CI runs the provider acceptance helper tests; the full Docker run stays local.
@prk-Jr prk-Jr self-assigned this Nov 19, 2026
A secret reference key is an operator-supplied string. If a secret value were
pasted into a reference field, an error naming the key would log it. Startup
errors now name the config field paths that reference the missing secret,
using a new core secret_reference_paths helper, and the tests and smoke script
assert that no key appears.

The architecture guide now describes Axum's prepared-store snapshots, and the
integration environment attaches Axum's recent output when readiness times out.
Brings #1615, which now carries the identity integration chain (dhruv8sh's
spine with the core identity app, the protected native Geo from #1532, the
identity conformance suite from #1613, the certificate-check statement from
#1616, the health and startup-failure contract from #1617 applied to the
native production runner, and the creative-proxy identity disclosure
policy), into Axum production serving.

Axum startup: the PR's path-named secret diagnostics, its shared read-only
snapshot error and its crate-private snapshot type merge into the base's
prepare_native, so a missing or unreadable secret still names only its
config paths, and that failure now installs the failure router as the base
does. Cargo.toml keeps the PR's description and restores the temp-env
dev-dependency the PR removed, because the base's main.rs and native_geo.rs
tests use it; Cargo.lock stays the base's.

Tests: the startup test for a missing secret keeps the PR's diagnostic, the
path `ec.passphrase` and its no-reference-key check, and asserts them on the
failure router instead of an exit before listening. The failure-router
helpers in the startup and native acceptance tests return the log and use
the PR's secret check, which also covers the short passphrase fixture. The
native acceptance missing-secret loop keeps the PR's path and key checks on
the failure router. The PR's valid legacy inputs, Linux self-connection
probe, version assertion, no-secret-in-log checks and assertion messages
stay; the version assertion's message now names the liveness probe, which no
longer runs the middleware. The integration fixture keeps the PR's output
tail on both failure paths and polls /ready as the base does.

Scripts: smoke-axum.sh keeps the base's probe flow and cases and expects the
PR's path-named missing-secret diagnostics with a 503. The PR's checks that
no reference key and no present secret path is logged run for every
negative case. The provider acceptance script keeps the PR's captured
startup causes and Docker environment, and the base's /ready wait and
authenticated snapshot observation.

Docs: AGENTS.md keeps both new gates, renumbered. The adapter tables keep
the base's probe columns with the PR's production startup status. The PR's
Axum guide, production startup guide and getting-started text say that a
store the selected provider cannot prepare stops the process before it
listens, while a missing or invalid config value or secret leaves only the
probes answering, with /ready and every route at 503. The production
startup guide keeps the base's protected CloudFront Geo statement next to
the PR's record-store note.
Brings #1532's rename of the native Geo profile variable to
TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE and #1617's bash 3.2 fix for the
smoke credentials expansion into Axum production serving. The merge is
clean. Cargo.lock is the base's.
aram356 added a commit that referenced this pull request Nov 24, 2026
Brings #1635, which now carries the identity integration chain (dhruv8sh's
spine with the core identity app, the protected native Geo from #1532, the
identity conformance suite from #1613, the certificate-check statement from
#1616, the health and startup-failure contract from #1617 applied to the
native production runner, and the creative-proxy identity disclosure policy
from #1615), into the after-response task drain on SIGTERM.

Docs: the production startup guide keeps the base's boundary, where a store
the selected provider cannot prepare stops the process before it listens and
a missing or invalid config value or secret leaves only the probes
answering, and adds the PR's shared shutdown grace for in-flight requests
and registered after-response tasks, its whole-task identity budget and its
A2/A8 activation note.

Tests: the PR's Axum after-response fixtures build GeoInfo with the base's
optional city, continent, coordinates and metro code. The values are
unchanged.

Code merges without conflict: the PR's Axum fallback scheduling, its shared
core runner and its Fastly post-delivery changes compile on the base's
identity app, conformance hook and failure router. Cargo.lock is the base's
plus the PR's trusted-server-identity-providers dev-dependency edge for the
Axum crate.
aram356 added a commit that referenced this pull request Nov 24, 2026
Brings #1635, which now carries the identity integration chain (dhruv8sh's
spine with the core identity app, the protected native Geo from #1532, the
identity conformance suite from #1613, the certificate-check statement from
#1616, the health and startup-failure contract from #1617 applied to the
native production runner, and the creative-proxy identity disclosure policy
from #1615), into the serving runtime environment guard.

The merge has no textual conflict, but the PR's guard rejected three
process-environment reads the protected native Geo added in the Axum
native_geo.rs: the TS boot profile path, read twice with var_os, and
EdgeZero's Geo provider setting. Each read now sits in a one-line private
helper with a scoped clippy::disallowed_methods allowance and a reason
comment, marked as a stopgap pending review. The reads, their names, the
var_os handling of a non-Unicode path and kv_selected's short-circuit order
are unchanged, and runtime_env!'s allowlist is untouched. The guard still
rejects any other unsuppressed read in that file.

AGENTS.md: the PR's guard gate follows the base's production health and
startup contract gate as item 20, in the same list.

Cargo.lock is the base's.
aram356 added a commit that referenced this pull request Nov 24, 2026
Brings #1532's rename of the native Geo profile variable to
TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE and #1617's bash 3.2 fix for the
smoke credentials expansion into the after-response task drain. The merge
is clean. Cargo.lock is unchanged from the PR's previous merge.
aram356 added a commit that referenced this pull request Nov 24, 2026
Brings #1532's rename of the native Geo profile variable to
TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE and #1617's bash 3.2 fix for the
smoke credentials expansion into the serving runtime environment guard, and
replaces this PR's earlier stopgap for the protected native Geo reads.

Axum native Geo: the profile path and EdgeZero's Geo provider override are
read through runtime_env!, so the stopgap helpers and their scoped
clippy::disallowed_methods allowances go. An absent profile still defers to
EdgeZero, and a profile path that is not Unicode now reports the profile's
Unavailable error instead of being read. kv_selected still declares the Geo
KV store only when no profile is set and EdgeZero's override selects kv.

runtime_env!: one justified allowlist entry for
EDGEZERO__ADAPTER__GEO__PROVIDER, EdgeZero's own native Geo provider
override, read only to decide whether the app declares the Geo KV store,
because EdgeZero exposes no API for that selection. The macro's docs and the
AGENTS.md gate name it beside the Fastly metadata exceptions.

Tests: the guard fixtures accept the new name through the checked macro and
still reject other EDGEZERO__ names. A native Geo unit test pins the
non-Unicode profile path as Unavailable.

Cargo.lock is the base's.
aram356 added a commit that referenced this pull request Nov 24, 2026
Brings #1635, which now carries the identity integration chain (dhruv8sh's
spine with the core identity app, the protected native Geo from #1532, the
identity conformance suite from #1613, the certificate-check statement from
#1616, the health and startup-failure contract from #1617 applied to the
native production runner, and the creative-proxy identity disclosure policy
from #1615), into the adapter store inventory.

Fastly app: the PR's per-request generic KV store helper stays next to the
base's publisher_fallback_methods, which the startup failure responses
share.

Adapter READMEs: each keeps the PR's store statements (Axum's unavailable
generic KV with no adapter-local store, Cloudflare's per-request
TRUSTED_SERVER_KV binding and missing request-time config store, Spin's
default label and opt-in trusted_server_kv label) and the base's sentence
that /health, /ready and startup failures follow the operational probe
contract. The PR's statements that Cloudflare has no /health route and that
a Spin startup failure answers /health with 503 go, because the base serves
the probes.

API reference: the dispositions paragraph keeps the PR's Cloudflare
discovery and verification note and the base's failure-router wording,
without the PR's "exits with status 1" disposition and Axum exit, which the
base's contract replaced.

Spin guide: the PR's runtime boundaries for the default label, encoded
signing keys and the opt-in KV label stay, followed by the PR's integration
CI note and the base's health and startup smoke note in place of the PR's
manual smoke sentence. Cloudflare guide: the smoke instructions keep the
base's Wrangler pin, so the PR's note that the stack has no pin goes.

Cargo.lock is the base's.
aram356 added a commit that referenced this pull request Nov 24, 2026
Picks up #1635's new head, which carries #1532's rename of the native
Geo profile variable to TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE and
#1617's bash 3.2 fix for the smoke scripts. The merge is clean.
@aram356
aram356 removed this pull request from stack #1638 November 24, 2026 06:29
@aram356
aram356 changed the base branch from baseline/native-aws-20261110 to docs/1233-proxy-disclosure-policy November 24, 2026 06:29
@aram356
aram356 added this pull request to stack #1658 November 24, 2026 06:29
aram356 added a commit that referenced this pull request Nov 24, 2026
Brings in, through #1636 (cf1102c):
- dhruv8sh's spine on #1489: #1639 (738ba34), #1640 (46530d8),
  #1612 (36e35f8), #1628 (384a481) and #1623 (6fd236e).
- #1531 (47411de) and #1532 (4d17086, which renames the native Geo
  profile variable to TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE).
- #1613 (2415b7d), then #1616 (c142e87), #1617 (b91770e) and
  #1615 (255c390), restacked on #1613.
- #1635 (06b4044), restacked on #1615, and #1636 (cf1102c).

Each conflict was resolved in the PR that sits higher. This merge is clean.
@aram356

aram356 commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), this PR now sits on #1615 instead of #1531, so it carries #1532 and the #1616, #1617 and #1615 line. I changed the base to docs/1233-proxy-disclosure-policy.

58e25b5a4 merges #1615:

  • AGENTS.md keeps both new gates.
  • docs/guide/api-reference.md, axum-dev.md and getting-started describe Standardize health and startup-failure responses across adapters #1617's probe and failure-router boundary with this PR's production startup status.
  • docs/guide/native-rc-demo.md keeps this PR's record-store note and Extract the protected CloudFront Geo baseline #1532's CloudFront Geo statement.
  • scripts/smoke-axum.sh runs this PR's path-named diagnostics checks for every negative case.
  • The startup tests assert this PR's path, key and secret checks on the failure router.
  • The temp-env dev-dependency is back; the base's main.rs and native_geo.rs tests use it.

06b40446e merges #1615 again for #1532's rename and #1617's bash 3.2 fix; it is clean.

prk-Jr added a commit that referenced this pull request Nov 25, 2026
Bring in the current Axum production serving head (06b4044), including
the #1142 health and startup-failure contract and #1615's proxy identity
disclosure policy. Record-store binding and unsupported EC storage now run
inside prepare_native, so they install the failure router instead of
exiting; EdgeZero provider preparation still fails before listen. Axum
keeps enabled identity providers, and the first-party proxy reads its EC
through the shared identity app.
@prk-Jr
prk-Jr removed this pull request from stack #1658 November 25, 2026 14:44
@prk-Jr
prk-Jr added this pull request to stack #1673 November 25, 2026 14:44
prk-Jr added a commit that referenced this pull request Nov 25, 2026
Since #1635 merged in the #1142 health contract, an invalid config
envelope or a missing secret keeps the process listening with the
failure router: /health answers 200, /ready and every route 503 with the
fixed body. Assert that contract, each case's own diagnostic and that
initialization fails before the listener is ready, instead of an exit
before listen. Update the native container guide and the workflow step
name to match.
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids
from the Prebid config into the auction EIDs, and a99dd66, a62601b,
d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30
days from the UTC day start and pass the request time into finalize.

The merge had no conflicts.

It also brings b2d4bfd from #1488, which records the known UID hashes
on lookup results with a setter, so the provider IDs the write planner
logs are not derived from them.

The base now also carries #1506's repin of EdgeZero to rc/identity at
d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly
0.13.3, url 2.5.9 and Viceroy 0.22.0.

docs/guide/native-rc-demo.md conflicted only because this PR rewrites the
passage that named the EdgeZero pin. The merge keeps this PR's text.

docs/guide/architecture.md conflicts in the Axum limitations table:
#1617's 6d174a8 rewraps the table and replaces its Startup failure row
with the failure router and the failures that still exit before listening,
while this PR names the column Axum and describes config and secret-store
writes against read-only startup snapshots. The merge keeps this PR's
header and Config/secret-store row with #1617's Startup failure row.
aram356 added a commit that referenced this pull request Nov 25, 2026
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids
from the Prebid config into the auction EIDs, and a99dd66, a62601b,
d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30
days from the UTC day start and pass the request time into finalize. They
arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623,
#1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540,
#1566, #1624, #1641, #1642 and #1646, with #1646's move of the request
time into IdentityApp::finalize. It also brings d5276ee, which publishes
the native AWS runtime files without GNU mv -T, and Christian's merge
5597d3e of #1538 into #1540, through #1566's merge.

The base now also carries the Axum serving line (#1613, #1616, #1617, #1615,
#1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which
decodes the Spin discovery document with Response::json, and #1627's merge
of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI.

This PR already carries #1646's head 461aa0d, so the merge adds only
#1646's new merge 166944769 of #1642 and the chain below it, including the
identity conformance check that now strips the mirrored UID's exp.

It also brings b2d4bfd from #1488, which records the known UID hashes
on lookup results with a setter, so the provider IDs the write planner
logs are not derived from them.

Restacking on the Axum serving line conflicts in the Axum startup tests,
where #1617 waits for /ready, since liveness stays up after a caught
initialization failure, and this PR rewrites the wait to retry a port
collision and to require the child's own ready lifecycle event.

Axum startup tests: wait_ready keeps this PR's collision retry and
lifecycle check, then probes #1617's /ready and returns the /health
response once the child is ready.

The fixture drains each child's output through this PR's log readers, so
#1617's assert_serves_failure_router reaps the stopped child and reads
those captured logs instead of collecting the pipes, which the readers
already own.

The base now also carries #1506's repin of EdgeZero to rc/identity at
d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly
0.13.3, url 2.5.9 and Viceroy 0.22.0.

This PR now stacks on #1661 instead of #1646, so rc/identity can take both
as plain merges. #1661 sits on #1656 and #1626, which sit on #1646, so the
merge also brings #1626 (provider opt-outs and legacy EID expiry on Fastly
and Axum), #1656 (the configurable Edge Cookie browser gate) and #1661
(refusing EC creation when a trusted JA4 contradicts the User-Agent).

Fastly identity conformance fixture: #1661 records each scenario's runtime
TLS JA4 through a RuntimeTlsJa4 middleware in place of derived device
signals, takes the User-Agent from the scenario and drops the browser flag.
This PR adds geo consent requests with their own trusted client IP settings
and no browser device signals. The merge assembles the conformance app with
#1661's middleware and keeps this PR's geo_configured flag and
producer_settings. It sends the scenario's User-Agent unless the API request
supplies one, and inserts the scenario's JA4 only for requests without a geo
consent exchange, because this PR derived device signals only for those.

The base now also carries #1627's 4d0c1a2, which renames the generic
runtime KV store to trusted_server_runtime_kv, #1488's a610152 and
9104fd3, which add hashed-email intake for the LiveRamp and ID5
identity providers, #1646's aa31559, which gates identity writes for
rejected clients, and #1626's d07f789, which withholds a mirrored UID
while another source owner is opted out.

Fastly conformance JA4: the rebuilt #1661 merge supplies a trusted Python
JA4 behind the Chrome User-Agent for #1646's known non-browser API
requests, and this PR inserts the scenario's JA4 only without a geo
consent exchange, with its producer_settings. The merge keeps both: a
known non-browser request gets the Python JA4, any other request the
scenario's JA4 unless it is a geo consent exchange.

This PR's head moves to e8015ca, its clean merge of #1646's aa31559,
which the base already carries, so it adds no change beyond the base.

Axum lib.rs: the base now carries #1636, through #1626's merge of it, whose
after_response_drain_tests module sits where this PR adds its
geo_conformance module. The crate keeps both test modules.
aram356 added a commit that referenced this pull request Nov 25, 2026
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids
from the Prebid config into the auction EIDs, and a99dd66, a62601b,
d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30
days from the UTC day start and pass the request time into finalize. They
arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623,
#1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540,
#1566, #1624, #1641, #1642 and #1646, with #1646's move of the request
time into IdentityApp::finalize. It also brings d5276ee, which publishes
the native AWS runtime files without GNU mv -T, and Christian's merge
5597d3e of #1538 into #1540, through #1566's merge.

The base now also carries the Axum serving line (#1613, #1616, #1617, #1615,
#1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which
decodes the Spin discovery document with Response::json, and #1627's merge
of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI.

The merge also brings the 12 #1646 commits this PR lacked, from 48a43ae
to 461aa0d: dhruv8sh's page-phase lookup and /auction EID work
(48a43ae, 82fe088, 1d0a74f, 838586e and his chain merges a061c01,
ecf16e8, e1d23a0, edcf4c5 and 9a020e1), the merge 9cad928 of
#1641 into #1642, and prk-Jr's "Merge providers-awaited into shared
identity" (4ffbaf8) and "Restore Fastly auction browser gating"
(461aa0d).

Edge cookies guide: a conflict is the request lifecycle paragraph.
The merge takes #1646's sentences on positive identity cookies, core
expiries and /auction body EIDs, and keeps this PR's closing sentences on
the default ec.sliding_refresh = false flow and sliding renewal.

Fastly adapter tests: 82fe088 from #1646 removed the navigation-lookups
thread-local and the page-lookups argument of apply_edgezero_ec_finalize,
since the handler now collects page lookups onto the EC context. This PR's
sliding_ec_renews_held_publisher_identity_before_terminal_privacy test
drops its two take_navigation_lookups calls and passes no page lookups to
finalize. Its configuration has no record store or providers, so no
lookups were collected before either, and its assertions are unchanged.

It also brings b2d4bfd from #1488, which records the known UID hashes
on lookup results with a setter, so the provider IDs the write planner
logs are not derived from them.

The base now also carries #1506's repin of EdgeZero to rc/identity at
d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly
0.13.3, url 2.5.9 and Viceroy 0.22.0.

This PR now stacks on #1661 instead of #1646, so rc/identity can take both
as plain merges. #1661 sits on #1656 and #1626, which sit on #1646, so the
merge also brings #1626 (provider opt-outs and legacy EID expiry on Fastly
and Axum), #1656 (the configurable Edge Cookie browser gate) and #1661
(refusing EC creation when a trusted JA4 contradicts the User-Agent).

Cloudflare route tests: both PRs add a test at the end of the file. The
merge keeps both, this PR's
sliding_ec_configuration_preserves_unsupported_platform_responses and
#1661's ec_route_creates_no_record_whatever_the_bot_management_ja4.

Fastly sliding EC test: #1617, which now sits below this PR, answers GET
/health through the router's probe hook as an operational response, which
carries no EC state. This PR's
sliding_ec_renews_held_publisher_identity_before_terminal_privacy routes
/health through the router and expected EC state on every path but the
unsupported EC route, so it now also accepts the liveness probe without EC
state. Its check that /health issues no renewal cookie is unchanged.

The base now also carries #1627's 4d0c1a2, which renames the generic
runtime KV store to trusted_server_runtime_kv, #1488's a610152 and
9104fd3, which add hashed-email intake for the LiveRamp and ID5
identity providers, #1646's aa31559, which gates identity writes for
rejected clients, and #1626's d07f789, which withholds a mirrored UID
while another source owner is opted out.

Settings: this PR's MaxAgeDays and #1488's HashedEmailSource are both
added before Ec in settings.rs; the merge keeps both.

This PR's head moves to fbe5670, its merge of #1646's aa31559, which
models admitted clients in the core sliding tests, finalizes them with
the store gate and adds refused_client_gets_no_renewal_or_record_io, and
adds the proposal's review log. Taken as the change from the old head
668d501, the new head would replay #1646 commits the base already
carries in rebuilt form. The merge takes only fbe5670's own resolution,
the change from a plain merge of 668d501 and aa31559 to fbe5670:
the sliding tests and the proposal apply cleanly, and its Fastly sliding
test port is the one this merge already made.
aram356 added a commit that referenced this pull request Nov 25, 2026
…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.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 10ddb42b6, a merge of #1615's new head a270b9676. It brings #1617's notes on the Axum startup failure router (6d174a883, 4c07cad1d), the identity chain below, and #1506's repin of EdgeZero to rc/identity at d063a8e7 with main's Fastly SDK upgrade (#1671). Resolutions:

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

`docs/guide/native-rc-demo.md` conflicts only where this PR's own edits sit
next to the EdgeZero pin text; the merge keeps this PR's text with the new
pin.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed fa250b1d7, a merge of #1615's new head b0b84af1c, which brings #1506's repin of EdgeZero to rc/identity at 459bd27d (42e0c46c7): EdgeZero #275 at 0e2a58ae, the EdgeZero stack's test fixes and EdgeZero #536's bounded record update, RecordHandle::update. docs/guide/native-rc-demo.md conflicted only because this PR's own edits sit next to the EdgeZero pin text; the merge keeps this PR's text with the new pin.

@dhruv8sh dhruv8sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary

This PR finishes the Axum production startup work:

  • Missing-secret errors: the startup error now names the config field path of the missing secret. It never names the reference key or the value.
  • Store write errors: the two read-only snapshot error helpers are merged into one.
  • Visibility: NativeStoreSnapshot is narrowed to pub(crate).
  • DataDome: when the checked RequestInfo fails, the payload now leaves out Host and Protocol. It no longer falls back to the raw header or the URI.
  • Tests: the startup and acceptance tests are stronger. The before-listen probe ignores a socket connected to itself, the legacy env inputs are now valid values, and the no-secrets-in-logs checks also run after successful runs.
  • Integration tests: the Axum test environment keeps the last 40 output lines and attaches them when startup fails.
  • Provider acceptance script: it starts via import.meta.main, adds --dns, passes DOCKER_HOST through, and checks the output of failed launches. A CI job runs its unit tests.
  • Docs: rewritten to describe Axum as a production entry point.

There are no blocking problems, only three small non-blocking points below. Nothing in the PR looks like an attempt to manipulate the reviewer.

Cross-cutting / body-level findings

  • 🤔 The secret check can miss output after 64 KiB: launch() keeps only the first 64 KiB of a failed launch's output. The no-secret check would not catch a secret printed after that point. This is fine for short startup failures.
  • 🏕 The plan doesn't match the diff on temp-env: the plan and spec say the unused temp-env dev-dependency is removed, but the diff doesn't change the dependencies in the Axum crate's Cargo.toml. Either remove it or correct the docs.
  • 🌱 wait_for_readiness could hang: it joins the reader threads after the child exits. That would block if a grandchild process kept the pipes open. This is unlikely with the current binary.

CI Status

  • integration tests: PASS
  • integration tests (Fastly EC lifecycle): PASS
  • cargo test (cross-adapter parity): PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • vitest: PASS
  • ts dev lint domains (changed lines): PASS
  • HTML EOF runtime (Fastly): PASS
  • cargo test (axum native): PASS
  • cargo test: PASS
  • browser integration tests: PASS
  • trace runtime and browser acceptance: PASS
  • cargo fmt: PASS
  • release scripts: PASS
  • format-typescript: PASS
  • CI Node pin guard: PASS
  • format-docs: PASS
  • Native provider acceptance script: PASS
  • CLAUDE.md symlink guard: PASS
  • prepare integration artifacts: PASS
  • health-startup (spin): PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • health-startup (cloudflare): PASS
  • cargo check/build/test (spin native + wasm32-wasip1): PASS
  • Fastly response diff script: PASS
  • health-startup (axum): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • docs-proposal scripts: PASS
  • worker-deadlines (cloudflare): PASS
  • health-startup (fastly): PASS
  • worker-deadlines (spin): PASS

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

`docs/guide/native-rc-demo.md` conflicts only where this PR's own edits sit
next to the EdgeZero pin text; the merge keeps this PR's text with the new
pin.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 353aee724.

Takes #1615's new head 06f9264, 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).

docs/guide/native-rc-demo.md conflicts only where this PR's own edits sit next to the EdgeZero pin text; the merge keeps this PR's text with the new pin.

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

Approved. I reviewed this PR's changes against #1615 at 06f926484. The Axum startup checks and provider helper tests passed. The inline findings are non-blocking. I did not verify the full Docker provider run or live DataDome behavior.


## Run locally

From the repository root, with `ts` built from this checkout:

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.

P2 · R1: Use a disposable checkout for this example

The new recipe overwrites an existing trusted-server.toml and republishes the starter config to the default local store without prompting. Git ignores both destinations, so it cannot restore the old inputs. Please require a disposable checkout or use separate input paths.

Suggested change
From the repository root, with `ts` built from this checkout:
From the root of a fresh or disposable checkout, with `ts` built from that checkout:

stream.setEncoding('utf8')
stream.on('data', (chunk) => {
if (output.text.length < maxCapturedOutput)
output.text = (output.text + chunk).slice(0, maxCapturedOutput)

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.

P2 · R2: Don't pass the log check on partial output

If the expected cause is in the retained prefix and a fixture secret appears after the cap, outputHolds returns success. Mixing stdout and stderr can also interrupt a match across chunks. Could we check the streams separately and fail on overflow, or scan each incrementally with bounded overlap? Keep capture and checking together in the rejection helper and keep raw output private.

// explicit DOCKER_HOST endpoint is the only daemon selection passed through.
export function dockerEnvironment(work, env = process.env) {
const docker = { PATH: env.PATH, HOME: work }
if (env.DOCKER_HOST) docker.DOCKER_HOST = env.DOCKER_HOST

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.

P2 · R3: Reject Docker endpoints the local fixture can't use

An inherited remote DOCKER_HOST is forwarded before any topology check. That can pull images or start containers on another host, but the bind source and the 127.0.0.1 endpoints are local to this script. Could we keep support for alternate local sockets and fail early for unsupported remote daemons?


| Requirement | State on #1531 | This change |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AX-1 missing secret exits non-zero before the port opens | `missing_secret_fails_before_listen_without_legacy_fallback`; runs in CI | The missing-secret diagnostic names the config path of the missing secret; the before-listen probe stops counting a Linux self-connection as a listener |

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.

P2 · R4: Document both startup failure states

The AX-1 and preservation rows describe the older before-bind requirement and cite a missing-secret test that no longer exists. On #1615, provider preparation failure exits before bind; a missing secret in a prepared store leaves GET/HEAD /health at 200, and /ready and supported ordinary routes at 503. Please update the design and guide summaries to match the existing probe contract. The design should also name #1615 as the direct base and link to the current EdgeZero pin, 1619078a, rather than certifying the historical pin.

.filter(|request| request.path == "/action")
.count(),
3,
"should forward no /action request beyond the three complete ones"

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.

P3 · R5: Count complete bodies, not all arrivals

tests/fixtures/native/origin.rs adds to received only after the body read succeeds. This assertion can pass if a fourth request arrives but its body read fails. I'd narrow the test and spec to the complete requests the fixture observes, unless no fourth arrival is an explicit requirement. In that case, count arrivals before reading the body.

Suggested change
"should forward no /action request beyond the three complete ones"
"should record only the three complete /action requests"

Comment on lines +117 to +119
`TRUSTED_SERVER__*` variables are applied by `ts config push` when it builds
the envelope; the running server does not read them. The older
`TRUSTED_SERVER_CONFIG_*` and `TRUSTED_SERVER_SECRET_*` variables are ignored.

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.

P3 · R7: Distinguish config overlays from the Geo boot setting

Axum does read TRUSTED_SERVER__NATIVE_GEO_PROFILE_FILE before provider preparation. Please limit the claim to app-config overlays and qualify the nearby Geo limitation: Geo is off by default, with opt-in request-scoped CloudFront support.

Suggested change
`TRUSTED_SERVER__*` variables are applied by `ts config push` when it builds
the envelope; the running server does not read them. The older
`TRUSTED_SERVER_CONFIG_*` and `TRUSTED_SERVER_SECRET_*` variables are ignored.
`ts config push` applies `TRUSTED_SERVER__*` app-config overlays when it builds
the envelope. Axum does not apply those overlays at runtime. It does read the
separate [native Geo boot setting](/guide/native-rc-demo#optional-protected-native-geo).
The older `TRUSTED_SERVER_CONFIG_*` and `TRUSTED_SERVER_SECRET_*` variables are ignored.

let listener_reachable =
TcpStream::connect_timeout(&self.addr, Duration::from_millis(20)).is_ok_and(
|stream| {
stream.local_addr().expect("should read probe source")

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.

Nit · R8: Reuse the tested self-connection predicate

This copies connected_to_listener from tests/native_acceptance.rs, where there are controls for real and self-connections. A small shared test helper would keep both probes on the implementation those controls exercise.

}

fn assert_failed_before_listen(&mut self, expected: &str) {
fn assert_failed_before_listen(&mut self, expected: &str) -> String {

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.

Nit · R9: Keep the before-listen helpers returning ()

No caller uses the new log return value here or from Running::rejected in tests/native_acceptance.rs. The failure-router helpers are the ones with callers that need the log.

}

/// Stops a running server and checks its whole output for secret values.
fn assert_logs_hold_no_secrets(&mut self) {

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.

Nit · R10: Name the fixture shutdown

Both assert_logs_hold_no_secrets helpers kill and reap the server before checking its logs. Could we call them stop_and_assert_no_secret_logs so a caller knows not to make another HTTP assertion afterward?

/// [`secret_reference_paths`].
///
/// # Errors
/// Returns a configuration error for malformed secret paths or references.

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.

Nit · R11: Include examples for the new public APIs

AGENTS.md:278 requires # Examples for public functions. Please show how to obtain the paths without printing the reference keys here and in secret_reference_paths.

Suggested change
/// Returns a configuration error for malformed secret paths or references.
/// Returns a configuration error for malformed secret paths or references.
///
/// # Examples
///
/// ```
/// use trusted_server_core::config_payload::VerifiedConfigBlob;
///
/// fn check_missing_field(blob: &VerifiedConfigBlob) {
/// if let Ok(references) = blob.required_secret_references() {
/// if let Some(paths) = references.get("fixture_key") {
/// for path in paths {
/// log::warn!("publish the secret for `{path}`");
/// }
/// }
/// }
/// }
/// ```

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.

Serve Axum in production mode from main

4 participants