Skip to content

Extract native prepared startup on the demo baseline - #1531

Open
ChristianPavilonis wants to merge 53 commits into
feat/identity-app-in-corefrom
baseline/native-aws-20261110
Open

ChristianPavilonis wants to merge 53 commits into
feat/identity-app-in-corefrom
baseline/native-aws-20261110

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The native Axum adapter now runs through EdgeZero's production runner and starts only from prepared config and secret stores. It reads the Trusted Server config envelope and the secrets that envelope references, validates the settings, and installs read-only in-memory copies and the router before it listens. Any failure exits with status 1 before listening.
  • The legacy TRUSTED_SERVER_CONFIG_* and TRUSTED_SERVER_SECRET_* variables and PORT are no longer read. Local runs use EDGEZERO__ADAPTER__CONFIG_DIR and EDGEZERO__SECRETS__<KEY>. Optional features add the AWS AppConfig Agent and Secrets Manager providers.
  • Checked ingress origin evidence takes precedence over a raw absolute request target for first-party proxy signing and the DataDome protection payload.

This PR is part of the identity integration chain (#1608). It stacks on #1623, and its base branch is feat/identity-app-in-core.

Changes

File Change
crates/trusted-server-adapter-axum/src/startup.rs New. Reads the envelope and its referenced secrets within EdgeZero's extraction byte, structure and time limits. Rejects request_signing.enabled and DataDome Config Store CIDR sources, which the snapshots cannot serve. Installs the read-only snapshots and the router.
crates/trusted-server-adapter-axum/src/main.rs Runs run_production_app_with_initializer with the TS initializer. Writes startup failures to stderr when no logger is installed yet.
crates/trusted-server-adapter-axum/src/app.rs Declares the config and secret stores. The initializer builds the router. Removes the env-backed settings path.
crates/trusted-server-adapter-axum/src/platform.rs Removes the env-backed config and secret stores. Request services read the startup snapshot, and a request without one fails.
crates/trusted-server-adapter-axum/Cargo.toml Adds the aws-appconfig-agent and aws-secrets-manager features, both off by default, and EdgeZero's native-bindings. Updates dev-dependencies.
crates/trusted-server-core/src/config_payload.rs, secret_resolution.rs VerifiedConfigBlob verifies an envelope, enforces structure limits, lists the required secret keys without reading a store, and resolves settings from the loaded secrets.
crates/trusted-server-core/src/proxy.rs First-party proxy signing takes the scheme from managed ingress when it is present.
crates/trusted-server-core/src/integrations/datadome/protection.rs The protection payload takes Host and Protocol from managed ingress. When ingress cannot be resolved, it omits those fields instead of falling back to the raw request target.
crates/trusted-server-adapter-axum/tests/startup.rs, native_acceptance.rs, fixtures/native/ Tests run the real binary: startup rejection before listening, redaction, legacy-input poisoning, real routes, POST bodies, read-only snapshots and adoption on restart, authenticated gateway isolation, truncated uploads, and SIGTERM drain.
crates/trusted-server-integration-tests/tests/, crates/trusted-server-adapter-axum/tests/routes.rs, scripts/smoke-axum.sh Harnesses supply a prepared config directory and EDGEZERO__SECRETS__* values.
scripts/test-native-providers.mjs, scripts/tests/test-native-providers.test.mjs Local provider acceptance against pinned Moto and AppConfig Agent containers, plus unit tests for its helpers.
.github/workflows/format.yml Runs the provider script's unit tests.
docs/guide/getting-started.md, docs/guide/axum-dev.md, docs/guide/native-rc-demo.md, crates/trusted-server-adapter-axum/README.md, .env.example Document the prepared inputs, restart to pick up changes, fatal startup, and the native limits. For example, there is no JWKS store, so discovery answers the shared 500.

Out of scope: provisioning, deployment, native EC persistence and native Geo.

Closes

Refs #1530. This PR completes one part of the baseline extraction and does not close the tracker.

Spec

Not a feature. This PR moves the existing native prepared-startup behavior onto the identity integration chain and corrects its callers and documentation.

Test plan

  • cargo test --locked -p trusted-server-adapter-axum, default and --all-features
  • cargo test -p trusted-server-core --lib datadome
  • cargo clippy-axum && cargo clippy-fastly
  • cargo fmt --all -- --check
  • Other: node --test scripts/tests/test-native-providers.test.mjs
  • Other: node scripts/test-native-providers.mjs <binary> with --features aws-appconfig-agent,aws-secrets-manager passes config-only, secret-only and combined modes, including the provider-failure causes. It contacts no AWS account.
  • Other: the getting-started Axum commands, run in a temporary directory, serve /health
  • cargo test-fastly, the other adapter suites, and the JS and docs format checks are left to hosted CI
  • The ignored real Next.js test (real_nextjs_action_and_api_after_truncated_post) needs a local fixture and was not run

Local fixtures don't cover live AWS, images, fleets or publishers.

Checklist

  • Feature PRs: not applicable
  • Changes follow AGENTS.md conventions
  • No unwrap() in production code
  • Uses log macros, apart from the documented stderr fallback for pre-logger startup failures
  • New code has tests
  • No secrets or credentials committed. All fixture values are synthetic.

@prk-Jr prk-Jr 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

REQUEST_CHANGES: one blocking finding at b121676, reviewed against the frozen demo baseline 2dd968a.

Blocking

  • 🔧 [P1] Start native bidder requests before returning pending handles — see inline at crates/trusted-server-adapter-axum/src/outbound.rs:250–253.

Verification and limits

An isolated probe against the exact pinned EdgeZero native client confirmed that requests make no connection before batch collection, work when collection begins, and expire without contacting the server when collection is delayed 80 ms against a 40 ms budget. The complete publisher consequence is source-traced; the probe executed the underlying transport behavior.

Local provider-helper tests passed under pinned Node; shell syntax and diff checks passed. Full Rust suites were not rerun. Real provider acceptance and Spin host/interface qualification remain unverified here; large unchanged source/test sections were sampled around affected consumers. CodeQL is main-base-only and did not run for this historical baseline.

CI Status

All 18 reported checks pass for the reviewed revision. No required checks are reported for this baseline branch.

  • integration tests: PASS
  • integration tests (Fastly EC lifecycle): PASS
  • browser integration tests: PASS
  • format-typescript: PASS
  • docs-proposal scripts: PASS
  • CLAUDE.md symlink guard: PASS
  • format-docs: PASS
  • cargo fmt: PASS
  • prepare integration artifacts: PASS
  • cargo check/build/test (spin native + wasm32-wasip2): PASS
  • cargo test: PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • cargo test (cross-adapter parity): PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • vitest: PASS
  • cargo test (axum native): PASS
  • PBS Terraform and Compose checks: PASS

@ChristianPavilonis
ChristianPavilonis marked this pull request as ready for review November 11, 2026 13:56
Retain the existing native feature head and current-main cutover history. Build the application router only after bounded prepared config and secret snapshots pass runtime validation, preserving operator publication rules and application forwarding authorization.

Use EdgeZero's production lifecycle and direct outbound path. Keep native EC and explicit storage for their later feature units. Preserve checked and unavailable ingress origin handling without restoring the old native HTTP bridge.

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

Reviewed at 65ba4f3df against the frozen baseline 2dd968aee, with EdgeZero source read at 83d7a629. The native prepared-store startup itself holds up: every invalid-input path we traced or probed fails before the listener binds, there is no legacy env fallback, snapshots are bounded and immutable, and ingress trust (host, scheme, client IP) cannot be spoofed by a direct client. The blocking issues are behaviour changes this unit introduces on the request path (413 to 400 on every non-Axum adapter, a new 8 MiB upload cap reported as 502, native responses served uncompressed), production wiring that tests don't reach, and harness checks that can pass without proving anything.

10 of the inline comments carry a one-click GitHub suggestion. Use Commit suggestion (or Add suggestion to batch for several at once) to apply them. Each was applied alone to this head and checked; see "Verification" below. The remaining comments describe the fix in prose because it spans files or needs new tests.

Blocking

🔧 wrench

  • Oversized API bodies now return 400 instead of 413, and skip finalize headers (all adapters): see inline at crates/trusted-server-adapter-fastly/src/app.rs:578
  • New 8 MiB default upload cap turns large publisher POSTs into 502: see inline at crates/trusted-server-core/src/platform/http.rs:97
  • Native responses served decoded under the origin's gzip ETag: see inline at crates/trusted-server-adapter-axum/src/outbound.rs:108
  • Fastly delivery tests bypass the production gate, finalizer and observer: see inline at crates/trusted-server-adapter-fastly/src/delivery_tests.rs:47
  • Spin snapshot install and streamed-body buffering are untested (mutation survivors): see inline at crates/trusted-server-adapter-spin/src/startup.rs:333
  • Spin missing-secret diagnostics no longer name the secret: see inline at crates/trusted-server-adapter-spin/src/startup.rs:170
  • Gateway-isolation test fails on macOS (suggestion): see inline at crates/trusted-server-adapter-axum/tests/native_acceptance.rs:579
  • Self-connection fix missing from the startup no-listener probe (suggestion): see inline at crates/trusted-server-adapter-axum/tests/startup.rs:101
  • Provider acceptance script exits 0 without running via a symlinked path (suggestion): see inline at scripts/test-native-providers.mjs:628
  • Missing-config test cannot detect a legacy fallback: see inline at crates/trusted-server-adapter-axum/tests/startup.rs:220
  • Body-level: prk-Jr's P1, stale operator docs, CI rerun (below)

❓ question

  • Is a 30 s response-write cutoff on every routed response intended?: see inline at crates/trusted-server-adapter-fastly/src/app.rs:1324
  • Should a signing inconsistency take down every Spin route, including /health?: see inline at crates/trusted-server-adapter-spin/src/startup.rs:227

Non-blocking

🤔 thinking / ♻️ refactor / 🏕 camp site / ⛏ nitpick

  • 🤔 Enforceable-deadline claim contradicts core and discards late mediator results (suggestion): see inline at crates/trusted-server-adapter-axum/src/outbound.rs:295
  • 🤔 x-edgezero-proxy header reaches clients (suggestion): see inline at crates/trusted-server-adapter-axum/src/outbound.rs:114
  • 🤔 Reused Fastly sandbox retires on every post-commit delivery failure: see inline at crates/trusted-server-adapter-fastly/src/main.rs:552
  • 🤔 Spin lists and reads the whole default store on every invocation: see inline at crates/trusted-server-adapter-spin/src/startup.rs:204
  • 🤔 Budget tests construct an unreachable timeout = None state: see inline at crates/trusted-server-adapter-axum/src/outbound.rs:344
  • 🤔 Upload-collection deadline in send_async has no test: see inline at crates/trusted-server-adapter-axum/src/outbound.rs:195
  • 🤔 Truncated-POST check cannot see an aborted upload delivered as complete (suggestion): see inline at crates/trusted-server-adapter-axum/tests/native_acceptance.rs:705
  • 🤔 Missed adapter buffer surfaces as a client 400 with an internal message: see inline at crates/trusted-server-core/src/auction/endpoints.rs:151
  • 🤔 Mutable git tag = on a frozen baseline: see inline at Cargo.toml:59
  • 🤔 native-rc-demo.md is an orphan page written as a review note: see inline at docs/guide/native-rc-demo.md:1
  • 🤔 Spec contradicts this unit: see inline at docs/superpowers/specs/2026-10-20-edgezero-431-compatibility-design.md:5
  • 🤔 Cloudflare smoke no longer runs on macOS or with asdf/mise: see inline at scripts/smoke-cloudflare.sh:15
  • ♻️ enforce_basic_auth_parts has no tests: see inline at crates/trusted-server-core/src/auth.rs:95
  • 🏕 Restore the dropped marker rationale (suggestion): see inline at crates/trusted-server-core/src/auth.rs:83
  • ⛏ Enforce "no environment proxy" (suggestion): see inline at scripts/test-native-providers.mjs:132
  • ⛏ Stale Spin target comment (suggestion): see inline at .cargo/config.toml:56
  • ⛏ Doc summary order on MAX_AUCTION_BODY_SIZE (suggestion): see inline at crates/trusted-server-core/src/auction/endpoints.rs:46
  • ⛏ Fastly finalize and log cleanups: see inline at crates/trusted-server-adapter-fastly/src/main.rs:503

Cross-cutting / body-level findings

  • 🔧 prk-Jr's P1 (lazy send_async) is still open at this head. The last two commits only swap rev = for a tag resolving to the same 83d7a629, so outbound.rs:243-255 is unchanged, and EdgeZero's Axum start_batch_until still builds unpolled async move { client.execute(..) } futures. No test catches it (separate_rc_batches_progress_concurrently_during_select passes only because select polls both handles). This regression test fails at head and passes with an eager control, so it can land with the fix in tests/native_http.rs:

    #[tokio::test]
    async fn send_async_dispatches_before_select_or_wait() {
        let listener = tokio::net::TcpListener::bind("127.0.0.1:0")
            .await
            .expect("should bind eager-dispatch origin");
        let address = listener.local_addr().expect("should read origin address");
        let client = bridge();
        let pending = client
            .send_async(request(&format!("http://{address}/bid"), "eager"))
            .await
            .expect("should start pending request");
        let accepted = tokio::time::timeout(Duration::from_millis(500), listener.accept()).await;
        assert!(
            accepted.is_ok(),
            "should start bidder transport at send_async, before select or wait polls it"
        );
        drop(pending);
    }
  • 🔧 Operator docs still describe the startup this PR removes (all outside the diff):

    • docs/guide/axum-dev.md:9-41 and crates/trusted-server-adapter-axum/README.md:7-12 document the TRUSTED_SERVER_CONFIG_* / TRUSTED_SERVER_SECRET_* env bridge and "every route returns 500"; the binary now exits before listening, and smoke-axum.sh sets those variables as poison.
    • docs/guide/spin.md:9-16,40-43 documents a 503 router with /health kept up and signing unavailable; the Spin README itself now calls those expectations invalid.
    • docs/guide/api-reference.md:21,24 matrix rows for axum and spin.
    • edgezero.toml dropped [stores.kv], but docs/guide/fastly.md:358-362, docs/guide/edgezero.md:30 and trusted-server.example.toml:78-80 still tell operators to provision trusted_server_kv.
    • AGENTS.md:22 still calls the Spin artifact a wasm32-wasip1 component; docs/guide/architecture.md:66,81,166 and docs/guide/testing.md:23,29 also still say wasip1 for Spin.
  • 🔧 CI did not complete on this head. prepare integration artifacts failed when actions/upload-artifact received HTML from the artifact service (an outage, not a code failure), so integration tests, integration tests (Fastly EC lifecycle) and browser integration tests were skipped. This head changes the browser job (--with-deps dropped, ubuntu-24.04), and those jobs have not run on it. Please re-run before merge.

  • ♻️ Run the new Node tests in CI. No workflow runs scripts/tests/test-native-providers.test.mjs or scripts/tests/test-smoke-cloudflare-home.test.mjs (the latter also skips off Linux); node --test scripts/tests/ in an existing ubuntu job would cover them. The smoke scripts, the provider acceptance run and the Spin 4.1 host run are local-only; please say in the description which of those were run on this head.

  • ♻️ Unused Axum dependencies: reqwest in [dependencies] (src/ no longer uses it; RC brings its own) and the temp-env and tower dev-dependencies (crates/trusted-server-adapter-axum/Cargo.toml:33,45,47).

  • 🤔 Native harness assertions that could be stronger:

    • Redaction checks skip the short EC passphrase ("short", native_acceptance.rs:236-238,419-425, startup.rs:84-86,131-138) and never check success-path logs; use a sentinel value and assert absence everywhere.
    • Nothing proves bounded SIGTERM: smoke-axum.sh:22-43 and test-native-providers.mjs:203-226 silently escalate to SIGKILL (the binary exits 0 about 6 ms after SIGTERM today, so a strict assertion would pass).
    • Provider failure cases (test-native-providers.mjs:397-413) run with stdio: 'ignore' and RUST_LOG: off, so they don't assert their cause ("startup config: … missing resource or version") or that no secret value is emitted; buffer the output in memory and check both.
    • Provider containers have unrestricted egress; --dns 127.0.0.1 on both docker run calls would enforce the account-free claim. dockerEnv drops DOCKER_HOST/DOCKER_CONTEXT, which breaks rootless and colima setups.
    • The secret half of the snapshot test (native_acceptance.rs:519-548) cannot change a running child's env, so it only proves restart adoption; startup.rs:246 says "until restart" but never restarts.
  • ⛏ Smaller items:

    • Cloudflare logging.rs:32-35 is fixed at Info with no override and doesn't set Hooks::owns_logging(), a new log-volume and PII surface in Workers Logs.
    • On native, /.well-known/trusted-server.json always returns 500 and /verify-signature always returns verified:false, because the JWKS store is rejected by the snapshot (app.rs:452-456); returning 501, as the admin key routes do, would make the unsupported consumer explicit.
    • Spin tests: the 128-key boundary is untested (> to >= survives), missing_required_secret_… asserts only is_err(), the "static " guard scans only startup.rs, and separate_invocations_… never calls initialize()/handle. startup.rs:396-401 initialize lacks # Errors, and app.rs:87 AppState::from_request has no doc comment.
    • Axum visibility and docs: NativeStoreSnapshot is pub but crate-internal (startup.rs:31), AxumPlatformHttpClient is exported at two paths, RequestInfo::from_request's doc doesn't say a pre-inserted extension now overrides every header and TLS source, and the header limits at outbound.rs:71-72 are magic numbers.
    • Many new assertions have no message (for example native_http.rs:104,129-131,281-285, native_acceptance.rs:382-390,472,506, startup.rs:250,258-261), and RouterHarness is duplicated in routes.rs:12-43 and parity.rs:18-49.
    • environments/axum.rs:113-121 attaches only the exit status on pre-listen failure; now that bad config is fatal before listen, attaching the last stderr lines would make CI failures diagnosable.
    • smoke-axum.sh still uses the Python origin and lacks the upload and duplicate Set-Cookie check the Fastly and Cloudflare smokes gained; scripts/README.md is stale for both.
    • .tool-versions uses the key spin-framework where main uses spin.
  • 📌 Follow-ups:

    • RustSec: rustls 0.23.45 (RUSTSEC-2026-0347, low; fixed in 0.23.46) and ctutils 0.4.3 (RUSTSEC-2026-0385; only via aws-sigv4, absent from default and wasm graphs) are new at this head.
    • EdgeZero asks: pre-dispatch RC errors (URI parse, admission Aborted) now send no response and retire a reused Fastly sandbox; detached 414/431 head-limit responses skip TS finalization; a typed delivery error would fix the sandbox-retirement finding; an encoded-passthrough response mode would fix the decoding finding.
    • The real Next.js action-after-truncated-POST reproduction exists only as an #[ignore] test CI never runs, and there are no native "disallowed origin" request tests (spec line 142). Please state whether the ignored test was run.
  • 🌱 Spin ignores the new timeout, deadline and max_response_body_bytes fields (platform.rs:430-500; same as base), so a hung bidder still blocks the invocation even though providers now set with_timeout. The test-only TRUSTED_SERVER__GIT_VERSION filter in settings.rs:3054-3062 differs from main's #1326 fix (BUILD_ENVIRONMENT_VARIABLES) and will conflict when this baseline moves up.

Verification

  • Each suggestion was applied alone to 65ba4f3df and checked, each followed by a byte-exact drift check:
    • Rust: cargo fmt --check, then clippy-axum (or check-fastly for the core comment and doc changes) and the affected Axum test binaries.
    • JS: node --check, the provider unit test, prettier, and a direct run of the script.
  • All ten were then applied together and run through the full gate on aarch64-apple-darwin: fmt; the six adapter clippy lanes; test-fastly (3,251), test-fastly-reuse (222), test-axum default and --all-features (77), test-cloudflare (55), test-spin (99) and parity (17). Everything passed with no drift.
  • The two test snippets in prose were run too: the send_async regression test fails at head, and the upload-deadline test passes at head and fails against the mutant.
  • Spin findings come from cargo test-spin, mutation runs and a Spin 4.1.0 host run of the wasm32-wasip2 artifact. Fastly findings come from Viceroy probes. The decoding and proxy-header findings come from a gzip origin through the real Axum bridge.
  • Not verified here: real AWS providers, the hosted browser and integration jobs (skipped by the outage above), and the ignored Next.js test.

CI Status

  • cargo fmt: PASS
  • cargo test: PASS
  • cargo test (axum native): PASS
  • cargo test (cross-adapter parity): PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • cargo check/build/test (spin native + wasm32-wasip2): PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • vitest: PASS
  • format-typescript: PASS
  • format-docs: PASS
  • docs-proposal scripts: PASS
  • CLAUDE.md symlink guard: PASS
  • PBS Terraform and Compose checks: PASS
  • prepare integration artifacts: FAIL (artifact service outage during upload)
  • integration tests: SKIPPED
  • integration tests (Fastly EC lifecycle): SKIPPED
  • browser integration tests: SKIPPED

No required checks are reported for the baseline/native-aws-20261110 branch.

Comment thread scripts/test-native-providers.mjs Resolved
Comment thread .cargo/config.toml Resolved
Comment thread crates/trusted-server-core/src/auth.rs Resolved
…tity

Keep the public PR 1506 documentation closeout, current-main public-origin and version guidance, and operator-versus-live-runtime schema behavior. Update active pin descriptions to the already-qualified EdgeZero prerelease. The only Rust change in the closeout is documentation on the existing Fastly error helper.
Preserve main 06e51be through an ordinary merge. Keep strict operator integration IDs/fields, the intended live-runtime warning policy and the existing framing/TLS/readthrough compatibility distinction.

Adapt mediator error fallback and its telemetry assertions to direct bounded EdgeZero calls. HTTP failures and provider Error statuses rank collected bids locally with floors; valid no-bid and 204 remain final mediation decisions. Exercise both ordinary and split dispatch/collect paths, without restoring old HTTP/backend or executor bridges.
The qualification target is intentionally outside the checkout. Ask Cargo for its actual output root rather than executing binaries under a hardcoded ignored target directory. Preserve all cache and purge assertions.
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 f94f6f9e9, a merge of #1623's new head 3e7b13b89. It brings the identity chain below, including #1488's hashed-email intake and #1489's mirrored UID expiry cap, and #1506's repin of EdgeZero to rc/identity at d063a8e7 with main's Fastly SDK upgrade (#1671). docs/guide/native-rc-demo.md, which this PR adds, names the EdgeZero pin and now names d063a8e7. Cargo.lock is re-resolved so it passes --locked; only dependency qualifiers change.

ChristianPavilonis added a commit that referenced this pull request Nov 25, 2026
…demo baseline

Source: baseline/native-aws-20261110 at f94f6f9.
Takes #1623's new head 61b4237, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.

This PR's own EdgeZero pin text moves from d063a8e7 to 459bd27d as well, in
`docs/guide/native-rc-demo.md`.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 2de7dc255, a merge of #1623's new head 61b4237f0, which brings #1506's repin of EdgeZero to rc/identity at 459bd27d (42e0c46c7): EdgeZero #275 at 0e2a58ae, the EdgeZero stack's test fixes and EdgeZero #536's bounded record update, RecordHandle::update. The merge had no conflicts. This PR's own EdgeZero pin text in docs/guide/native-rc-demo.md moves from d063a8e7 to 459bd27d as well.

Takes #1623's new head c0d0968, 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).

Cargo.lock is merged by package entry.

This PR's own EdgeZero pin text moves from 459bd27d to 1619078a as well, in
`docs/guide/native-rc-demo.md`.

Cargo.lock is re-resolved after the merge so it passes --locked: +aws-config
1.12.0 +aws-credential-types 1.3.0 +aws-runtime 1.10.0 +aws-sdk-sso 1.114.0
+aws-sdk-ssooidc 1.116.0 +aws-sdk-sts 1.119.0 +aws-sigv4 1.6.0
+aws-smithy-async 1.3.1 +aws-smithy-http 0.64.1 +aws-smithy-http-client
1.5.0 +aws-smithy-json 0.63.1 +aws-smithy-observability 0.3.0
+aws-smithy-query 0.62.1 +aws-smithy-runtime 1.16.0 +aws-smithy-runtime-api
1.19.0 +aws-smithy-runtime-api-macros 1.2.0 +aws-smithy-schema 0.2.1
+aws-smithy-types 1.9.0 +aws-smithy-xml 0.62.1 +aws-types 1.6.0 +base64-simd
0.8.0 +bytes-utils 0.1.4 +outref 0.5.2 +pin-utils 0.1.1 +regex-lite 0.1.9
+vsimd 0.8.0 +wasm-streams 0.5.0 +xmlparser 0.13.6.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 52076d8b0.

Takes #1623's new head c0d0968, 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).

Cargo.lock is merged by package entry.

This PR's own EdgeZero pin text moves from 459bd27d to 1619078a as well, in docs/guide/native-rc-demo.md.

Cargo.lock is re-resolved after the merge so it passes --locked: +aws-config 1.12.0 +aws-credential-types 1.3.0 +aws-runtime 1.10.0 +aws-sdk-sso 1.114.0 +aws-sdk-ssooidc 1.116.0 +aws-sdk-sts 1.119.0 +aws-sigv4 1.6.0 +aws-smithy-async 1.3.1 +aws-smithy-http 0.64.1 +aws-smithy-http-client 1.5.0 +aws-smithy-json 0.63.1 +aws-smithy-observability 0.3.0 +aws-smithy-query 0.62.1 +aws-smithy-runtime 1.16.0 +aws-smithy-runtime-api 1.19.0 +aws-smithy-runtime-api-macros 1.2.0 +aws-smithy-schema 0.2.1 +aws-smithy-types 1.9.0 +aws-smithy-xml 0.62.1 +aws-types 1.6.0 +base64-simd 0.8.0 +bytes-utils 0.1.4 +outref 0.5.2 +pin-utils 0.1.1 +regex-lite 0.1.9 +vsimd 0.8.0 +wasm-streams 0.5.0 +xmlparser 0.13.6.

Docs: the getting-started Axum quickstart and .env.example now use
EDGEZERO__ADAPTER__CONFIG_DIR and EDGEZERO__SECRETS__* instead of the
removed TRUSTED_SERVER_CONFIG_*/TRUSTED_SERVER_SECRET_* inputs. axum-dev.md
states that native snapshots carry no JWKS store.

Startup tests: the missing-config case requires "required snapshot
missing", probes and readiness ignore Linux TCP self-connections, a short
sentinel passphrase and every fixture secret are checked for redaction,
and the running-config test is named for what it checks.

Acceptance: the truncated-POST case counts every /action the origin
received, and the secret half of the snapshot test says it only proves
restart adoption.

Provider script: runs under import.meta.main, bypasses environment proxies
with agent: false, and checks each selected-provider failure's cause and
secret redaction in memory. Its unit tests run in CI.

DataDome omits Host and Protocol when managed ingress cannot be resolved
instead of falling back to the raw request target.

Cleanup: drop the unused temp-env dev-dependency, make
NativeStoreSnapshot crate-private, and add assertion messages.
@ChristianPavilonis

Copy link
Copy Markdown
Collaborator Author

Review feedback is addressed in 0bab84b, which sits on the latest #1623 merge (52076d8b0). The inline threads each have a reply. This comment covers the review-level points.

@dhruv8sh: getting-started still used removed inputs (blocking). Fixed. docs/guide/getting-started.md now exports EDGEZERO__ADAPTER__CONFIG_DIR="$PWD/.edgezero" and EDGEZERO__SECRETS__{PUBLISHER_PROXY_SECRET,EC_PASSPHRASE,HANDLER_PASSWORD}. The TRUSTED_SERVER_{CONFIG,SECRET}_* naming table is replaced, and the guide says changes need a restart and that PORT is not read. .env.example is updated the same way. I ran the quickstart commands in a temporary directory: ts config push --adapter axum --local, then the new variables, then the binary. /health returned ok.

@aram356: review-level items

  • Operator docs. The Axum README and axum-dev.md were updated in the earlier port. getting-started and .env.example are fixed above. axum-dev.md now also says the native snapshots carry no JWKS store, so on Axum /.well-known/trusted-server.json answers the shared 500 and /verify-signature always reports verified: false. I kept those responses rather than switching to 501, because native_acceptance relies on the 200 /verify-signature path for its body-limit check. The Spin, wasip1, trusted_server_kv and api-reference notes cover files this PR no longer changes.
  • CI rerun. The hosted checks on 52076d8b0 all passed (25), including the integration and browser jobs. They will run again on 0bab84b13.
  • Node tests in CI. A new format.yml job, "Native provider acceptance script", runs node --test scripts/tests/test-native-providers.test.mjs. test-smoke-cloudflare-home.test.mjs is not part of this PR any more.
  • Unused Axum dependencies. temp-env is removed. reqwest is now a dev-dependency only, used with blocking by native_acceptance. tower is no longer listed.
  • Harness assertions
    • Redaction: the short passphrase is now the unique value SENTINEL-short-ec-7f3a. Both tests/startup.rs and native_acceptance check that no fixture secret appears in failure output.
    • Bounded SIGTERM: not added to the scripts. production_sigterm_drains_the_admitted_publisher_response already asserts a graceful exit without a forced kill.
    • Provider failure cases now log at info into a bounded in-memory buffer that is never printed. They require startup config|secrets: trusted_server_{config,secret}s: missing resource or version and that no secret value appears. A full Docker run with the pinned Moto and AppConfig Agent images passes all 7 stages.
    • Deferred: --dns 127.0.0.1 (I haven't checked whether the Agent can still reach Moto with it) and passing through DOCKER_HOST/DOCKER_CONTEXT (contexts live in ~/.docker, which the script deliberately isolates).
    • Snapshot test: the secret half now says it only proves the new secret is picked up on restart, and that the provider acceptance script covers immutability while running. The tests/startup.rs case is renamed …_ignore_changed_config_while_running.
  • Smaller items.
    • NativeStoreSnapshot is now pub(crate).
    • Every assertion this PR adds in the Axum tests has a message.
    • Not changed: environments/axum.rs still drops child stdout, where EdgeZero logs, so an early exit reports only its status. Worth a follow-up.
    • Not changed: smoke-axum.sh still uses the Python origin and has no upload or Set-Cookie checks.
    • The Cloudflare, Spin, .tool-versions and duplicate RouterHarness points cover files outside this PR.
  • Follow-ups. RustSec and the EdgeZero asks belong with the base dependency graph and Cut Trusted Server over to EdgeZero PR 275 #1506. The real Next.js test is still #[ignore] and was not run for this head.

@prk-Jr: P1 lazy send_async. Answered inline. The TS bridge is gone, and dispatch timing at the current EdgeZero pin belongs with #1506.

Checks on 0bab84b: cargo test --locked -p trusted-server-adapter-axum with all features and with default features (lib 23, native_acceptance 11 + 1 ignored, routes 43, startup 8), cargo test -p trusted-server-core --lib datadome (74), cargo clippy-axum, cargo clippy-fastly, cargo fmt --check, the provider unit tests (6), the Docker provider acceptance run, actionlint 1.7.12 and the CI Node pin guard.

@prk-Jr prk-Jr 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

Follow-up review at 0bab84b13b, against base feat/identity-app-in-core at c0d0968a04 (which is also the merge base). The restack narrowed this PR to native prepared startup on Axum, the VerifiedConfigBlob and secret-key collection split in core, and the ingress-evidence changes for proxy signing and the DataDome payload. Startup fails closed before the listener binds. The bounded reads, structure limits and redaction hold up, and the router-state ordering is correct: set_router runs, then insert_state replaces the empty snapshot that router_builder installs. Every earlier blocking item that is still in scope has been addressed. I found no new blocking issues. Two non-blocking comments are below.

Blocking

None.

Non-blocking

🤔 thinking

  • Startup diagnostics don't say which secret is missing or why a read failed: see inline at crates/trusted-server-adapter-axum/src/startup.rs:244

🌱 seedling

  • The installed snapshot has no request-time consumer yet, so nothing tests it: see inline at crates/trusted-server-adapter-axum/src/startup.rs:270

Status of earlier findings

My earlier finding

  • 🔧 [P1] Lazy send_async in the native bridge (outbound.rs): no longer in this PR. The head has no TS outbound bridge. platform.rs takes request_outbound_client from core, and native dispatch is now EdgeZero's start_batch_until. At pin 1619078a that calls schedule_batch → spawn_owned on the outbound executor (source read; not re-probed). Any dispatch-timing question now belongs with the base chain or EdgeZero, not this PR.

@dhruv8sh

  • 🔧 Getting-started used removed inputs: resolved. getting-started.md and .env.example now use EDGEZERO__ADAPTER__CONFIG_DIR and EDGEZERO__SECRETS__*. I checked that EdgeZero at the pin honours the documented __KEY override (store_key) and the uppercase secret mapping (secret_env_var). ts config push --adapter axum already rejects key names that cannot map to an environment variable.
  • 🤔 DataDome raw-target fallback: resolved. The fallback is gone, and unresolvable_managed_ingress_omits_host_and_protocol_instead_of_raw_target covers it.
  • ⛏ reserve_port comment: resolved in both test files.

@aram356 (blocking items still in scope)

  • macOS gateway-isolation test: resolved. No 127.0.0.2/.3 binds remain, and the test passes locally on macOS.
  • Self-connection probe in tests/startup.rs: resolved (connected_to_listener).
  • Provider script exits 0 through a symlinked path: resolved (import.meta.main).
  • Missing-config test could not detect a legacy fallback: resolved. The test now requires required snapshot missing.
  • Operator docs: resolved for the files this PR owns. The Spin, wasip1 and KV notes now cover files outside this PR.
  • CI rerun: resolved. All 26 checks pass on this head.
  • The Fastly/Cloudflare/Spin, outbound.rs, platform/http.rs, auth.rs, .cargo/config.toml and spec findings point to code this PR no longer changes, so they are outdated here. Any that still apply belong with the base chain (#1506), as the author noted in each thread.
  • The native-rc-demo.md rewrite is partly addressed, and the author has deferred the rest. I'm fine with that.

Verification

  • cargo test-axum --all-features at this head on aarch64-apple-darwin: lib 23, native_acceptance 10 passed + 1 ignored (the Linux-only reflexive-connect test is compiled out on macOS), routes 43, startup 8. All passed.
  • I ran the built binary with each secret left out in turn. Each run printed the same diagnostic (see the inline comment).
  • I deleted app.insert_state(snapshot) and reran the whole Axum suite. It still passed (see the second inline comment).
  • Read only, not run: the core config_payload/secret_resolution/proxy/DataDome changes, the integration-test harness changes, smoke-axum.sh, test-native-providers.mjs and the docs.
  • Not run here: the Docker provider acceptance, the smoke script, the ignored real Next.js test, and the non-Axum suites. Hosted CI covers the non-Axum suites on this head.

CI Status

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

Comment on lines +237 to +244
).await.map_err(|_| configuration_error(
"failed bounded read of a required app-config secret; check the selected trusted_server_secrets provider, required references, extraction limits and deadline; legacy environment fallback is disabled",
))?;
remaining = remaining.checked_sub(read.backend_bytes).ok_or_else(|| {
configuration_error("native secret extraction exceeds the total byte budget")
})?;
let value = read.value.ok_or_else(|| configuration_error(
"a required app-config secret is missing in trusted_server_secrets; publish every active reference before starting",

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.

🤔 thinking: Startup diagnostics don't say which secret is missing or why a read failed

With one secret left out, the binary prints the same line whichever secret it is. I left out EC_KEY, then PROXY_KEY:

Trusted Server initialization failed: validation error: a required app-config secret is missing in trusted_server_secrets; publish every active reference before starting
trusted-server-adapter-axum failed: startup initializer: application: application checks failed

On the base, the same mistake named the setting path (failed to resolve secret reference at `ec.passphrase` …). The map_err(|_| …) on line 237 also drops the typed SecretError. An oversized value, an expired deadline and an unavailable provider therefore all produce one message that lists every possible cause. scripts/smoke-axum.sh:170-177 expects the same string for missing-handler, missing-proxy and missing-ec, so the smoke cannot show that each case failed for its own input.

The reference key is not a secret value: it is already in the pushed config. Naming the key (or the setting path) keeps the redaction guarantee:

let value = read.value.ok_or_else(|| {
    configuration_error(&format!(
        "required app-config secret `{key}` is missing in trusted_server_secrets; publish every active reference before starting"
    ))
})?;

Do the same on line 238. Optionally, map the error variant (not its message) to EdgeError::store_extraction(reason, …) so that EdgeZero's outer line reports MissingSecret/DeadlineExceeded instead of application checks failed. Then the three smoke cases can each check for their own key.

secret_store,
});
app.set_router(router);
app.insert_state(snapshot);

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.

🌱 seedling: The installed snapshot has no request-time consumer yet, so nothing tests it

validate_snapshot_consumers rejects every path that reads these stores at request time: signing and rotation, the JWKS-backed discovery and verification routes (which fail either way), and DataDome CIDR sources. Replacing this line with let _ = snapshot;, so that requests see the empty snapshot that router_builder installs, still passes the whole Axum suite (cargo test-axum --all-features: 23/10/43/8 green). The behaviour is unchanged today, so this is not a bug. When a consumer is admitted later (for example, declared JWKS and signing-key snapshots), please add a test in which a request reads a value from the installed snapshot, so this wiring is covered.

@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 moves the Axum adapter off the legacy TRUSTED_SERVER_CONFIG_* and TRUSTED_SERVER_SECRET_* environment stores. Startup now uses EdgeZero's run_production_app_with_initializer. Before the listener starts, initialize_native reads the prepared config and secret stores within byte and deadline limits, checks the envelope, loads only the active secret references, rejects consumers it cannot support (request signing, DataDome dynamic CIDR sources) and installs the router plus immutable snapshots. The core refactor (VerifiedConfigBlob, secret_reference_keys) is clean and adds no new behaviour. The process tests for "fails before listen" and "no legacy fallback" are thorough. I found nothing blocking. Two non-blocking concerns are below.

None of the inline comments carry a one-click suggestion. Both fixes touch more than one file (tests and the smoke script assert on the exact message text), so they are described in prose.

Non-blocking

🤔 thinking

  • Production router also carries the empty snapshot as router state — see inline at crates/trusted-server-adapter-axum/src/app.rs:662
  • Missing-secret diagnostics no longer say which secret is missing — see inline at crates/trusted-server-adapter-axum/src/startup.rs:243

👍 praise

  • Store metadata is tied to edgezero.toml by a test: handwritten_store_metadata_matches_the_manifest fails if the handwritten stores() metadata and the manifest drift apart. Pairing that with the poisoned legacy env values in the startup tests makes the "no fallback" guarantee hard to break without a test failing.

let forwarder_settings = Arc::clone(&state.settings);

let mut router = RouterService::builder()
.with_state(Arc::new(NativeStoreSnapshot::empty()))

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.

🤔 thinking — router_builder now attaches Arc::new(NativeStoreSnapshot::empty()) as router state for every router, including the production one: initialize_native builds it with TrustedServerApp::routes_with_settings(settings) and then calls app.insert_state(snapshot) with the real snapshot. Both are Arc<NativeStoreSnapshot> request extensions. So whether production requests see the real snapshot or the empty one depends on EdgeZero's merge order between router state and app state. Nothing in this repo pins that order.

Today this is mostly hidden: validate_snapshot_consumers rejects request signing and DataDome dynamic CIDR sources, which are the main request-time config_store() / secret_store() readers. No test in tests/startup.rs or tests/native_acceptance.rs reads the store at request time through the production path. If a later change adds such a consumer and the router state wins, it would fall back to the empty snapshot without any error.

One option is to keep the empty snapshot out of the shared builder and attach the right one at each entry point:

// app.rs: router_builder no longer calls .with_state(NativeStoreSnapshot::empty())
pub fn routes_with_settings(settings: Settings) -> Result<RouterService, Report<TrustedServerError>> {
    let state = build_state_with_settings(settings)?;
    Ok(router_builder(&state).with_state(Arc::new(NativeStoreSnapshot::empty())).build())
}

// startup.rs: build the production router with the real snapshot
pub(crate) fn routes_with_snapshot(settings: Settings, snapshot: Arc<NativeStoreSnapshot>) -> …

Apply manually: this touches app.rs and startup.rs together, so it can't be a single-file suggestion. If EdgeZero does guarantee that app state overrides router state, a short comment here citing that guarantee would also be enough.

remaining = remaining.checked_sub(read.backend_bytes).ok_or_else(|| {
configuration_error("native secret extraction exceeds the total byte budget")
})?;
let value = read.value.ok_or_else(|| configuration_error(

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.

🤔 thinking — Before this PR, a missing secret was reported with its setting path (failed to resolve secret reference at `handlers[0].password` ). Now every missing secret produces the same a required app-config secret is missing in trusted_server_secrets message, and the bounded-read failure at line 237 has the same problem. An operator with several references can't tell from the log which one to publish. The smoke script loses the same precision: missing-handler, missing-proxy and missing-ec in scripts/smoke-axum.sh all assert the identical string, so a case could pass for the wrong secret.

The key is a reference name taken from the config (for example proxy_key), not a secret value. The no-leak assertions in tests/startup.rs check FIXTURE_SECRETS values only, so naming the key should be safe:

let value = read.value.ok_or_else(|| {
    configuration_error(&format!(
        "required app-config secret `{key}` is missing in trusted_server_secrets; publish every active reference before starting"
    ))
})?;

Apply manually: the text is asserted in tests/startup.rs ("required app-config secret is missing") and in scripts/smoke-axum.sh. Those assertions need updating, and the smoke cases could then check per-key messages.

PR #1623's new head brings the cascaded owner review fixes from #1525, #1526, #1488, #1489 and #1639. The merge is clean.
PR #1623'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 textually clean; this link also moves #1531's own pin text.

docs/guide/native-rc-demo.md: #1531's guide names the workspace EdgeZero pin. It now names 8a73c0978806bdb60caccb17a6ddf34e14f3bd5e, the commit #1506 repins to.

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 0bab84b13 to 20274718d:

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

PR #1623'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 #1623'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 and #1639's pull reserve boundary check and wording.

The merge is textually clean; this link also moves #1531's own pin text.

docs/guide/native-rc-demo.md: #1531's guide names the workspace EdgeZero pin. It now names ef5cbf30878e0c6cdb8c706117c02add75493531, the commit #1506 repins to.

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 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 f0c969dc5 to 3e5132e06:

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

PR #1623'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 3e5132e06 to 1374a40ee:

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 035ca4a71, on top of 1374a40ee.

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 #1623's new head (b44f37073), 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.

@aram356

aram356 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Pushed fixes for findings from the #1608 review that trace to this PR, one commit per finding:

  • 2ae066a663 Trust native acceptance readiness only after the child logs its own ready event
  • dc9d252b22 Record the Axum config and secret input change in the changelog

The head then merges #1623's new head, which carries the fixes from lower in the stack.

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.

4 participants