Repository navigation
Extract native prepared startup on the demo baseline - #1531
ChristianPavilonis wants to merge 53 commits into
Conversation
prk-Jr
left a comment
There was a problem hiding this comment.
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
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
left a comment
There was a problem hiding this comment.
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 atcrates/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-proxyheader reaches clients (suggestion): see inline atcrates/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 = Nonestate: see inline atcrates/trusted-server-adapter-axum/src/outbound.rs:344 - 🤔 Upload-collection deadline in
send_asynchas no test: see inline atcrates/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 atCargo.toml:59 - 🤔
native-rc-demo.mdis an orphan page written as a review note: see inline atdocs/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_partshas no tests: see inline atcrates/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 atcrates/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 swaprev =for a tag resolving to the same83d7a629, sooutbound.rs:243-255is unchanged, and EdgeZero's Axumstart_batch_untilstill builds unpolledasync move { client.execute(..) }futures. No test catches it (separate_rc_batches_progress_concurrently_during_selectpasses only becauseselectpolls both handles). This regression test fails at head and passes with an eager control, so it can land with the fix intests/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-41andcrates/trusted-server-adapter-axum/README.md:7-12document theTRUSTED_SERVER_CONFIG_*/TRUSTED_SERVER_SECRET_*env bridge and "every route returns 500"; the binary now exits before listening, andsmoke-axum.shsets those variables as poison.docs/guide/spin.md:9-16,40-43documents a 503 router with/healthkept up and signing unavailable; the Spin README itself now calls those expectations invalid.docs/guide/api-reference.md:21,24matrix rows for axum and spin.edgezero.tomldropped[stores.kv], butdocs/guide/fastly.md:358-362,docs/guide/edgezero.md:30andtrusted-server.example.toml:78-80still tell operators to provisiontrusted_server_kv.AGENTS.md:22still calls the Spin artifact awasm32-wasip1component;docs/guide/architecture.md:66,81,166anddocs/guide/testing.md:23,29also still say wasip1 for Spin.
-
🔧 CI did not complete on this head.
prepare integration artifactsfailed whenactions/upload-artifactreceived HTML from the artifact service (an outage, not a code failure), sointegration tests,integration tests (Fastly EC lifecycle)andbrowser integration testswere skipped. This head changes the browser job (--with-depsdropped,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.mjsorscripts/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:
reqwestin[dependencies](src/no longer uses it; RC brings its own) and thetemp-envandtowerdev-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-43andtest-native-providers.mjs:203-226silently 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 withstdio: 'ignore'andRUST_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.1on bothdocker runcalls would enforce the account-free claim.dockerEnvdropsDOCKER_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:246says "until restart" but never restarts.
- Redaction checks skip the short EC passphrase (
-
⛏ Smaller items:
- Cloudflare
logging.rs:32-35is fixed at Info with no override and doesn't setHooks::owns_logging(), a new log-volume and PII surface in Workers Logs. - On native,
/.well-known/trusted-server.jsonalways returns 500 and/verify-signaturealways returnsverified: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 onlyis_err(), the"static "guard scans onlystartup.rs, andseparate_invocations_…never callsinitialize()/handle.startup.rs:396-401initializelacks# Errors, andapp.rs:87AppState::from_requesthas no doc comment. - Axum visibility and docs:
NativeStoreSnapshotispubbut crate-internal (startup.rs:31),AxumPlatformHttpClientis 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 atoutbound.rs:71-72are 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), andRouterHarnessis duplicated inroutes.rs:12-43andparity.rs:18-49. environments/axum.rs:113-121attaches 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.shstill uses the Python origin and lacks the upload and duplicate Set-Cookie check the Fastly and Cloudflare smokes gained;scripts/README.mdis stale for both..tool-versionsuses the keyspin-frameworkwhere main usesspin.
- Cloudflare
-
📌 Follow-ups:
- RustSec:
rustls 0.23.45(RUSTSEC-2026-0347, low; fixed in 0.23.46) andctutils 0.4.3(RUSTSEC-2026-0385; only viaaws-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.
- RustSec:
-
🌱 Spin ignores the new
timeout,deadlineandmax_response_body_bytesfields (platform.rs:430-500; same as base), so a hung bidder still blocks the invocation even though providers now setwith_timeout. The test-onlyTRUSTED_SERVER__GIT_VERSIONfilter insettings.rs:3054-3062differs from main's #1326 fix (BUILD_ENVIRONMENT_VARIABLES) and will conflict when this baseline moves up.
Verification
- Each suggestion was applied alone to
65ba4f3dfand checked, each followed by a byte-exact drift check:- Rust:
cargo fmt --check, thenclippy-axum(orcheck-fastlyfor 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.
- Rust:
- 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-axumdefault 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_asyncregression 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.
…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.
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.
…1622 into rc/identity #1622 (244ca26) now carries the whole chain, each PR merging the one below it: - #1506 (c197404) repins EdgeZero to rc/identity at d063a8e7, which carries EdgeZero main's Fastly SDK 0.13.3 upgrade through every EdgeZero PR here, and merges Trusted Server main's upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. - #1614, #1525, #1526, #1487 and #1488 take it in turn. #1488 also adds b2d4bfd, which records known UID hashes with a setter. - #1489, the identity spine (#1639, #1640, #1612, #1628 and #1623), #1531 and #1532. - The Axum serving line: #1613, #1616, #1617, #1615, #1635, #1637 and #1627, chained, with #1627's b958107 decoding the Spin discovery document with Response::json and #1627's merge of #1625, which brings #1625's Wrangler pin into the chain. - The held line on #1627: #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646. #1646 keeps its own shared after-response runner in ec::app::lookups. - #1636 (72096cd) on #1646 (b5a5f62), draining Axum after-response identity tasks on SIGTERM through #1646's shared runner. - The EC route line on #1636: #1626 (067531e), which merges #1636, the draft #1656, #1661, #1662 and #1622, and through #1622's merge of it, #1620's round-6 head. Each conflict was resolved in the PR that sits higher. This merge is clean. Since the last update the chain also takes #1488's hashed-email intake (a610152 and 9104fd3) and its POST, body and header options for the status call (f063a76), #1627's split of the generic runtime KV store into trusted_server_runtime_kv (4d0c1a2), #1646's gate on identity writes for rejected clients (aa31559) its native container test of the failure router (4f4c036) and that test's header check on an ordinary route (71a573a), #1626's withholding of a mirrored UID while another source owner is opted out (d07f789), and #1617's description of the Axum startup failure router (6d174a8) and of the startup failures that still exit before listening (4c07cad). #1636 no longer sits in the Axum serving line; it arrives through #1626, which merges it on top of #1646. Its new head adopts #1646's after-response runner in place of the one rc/identity took with cf1102c. Cloudflare guide: #1627's merge of #1625 now keeps both #1625's tool version clause and #1627's TRUSTED_SERVER_RUNTIME_KV binding in the smoke paragraph, and fixes #1625's smoke script test for #1617's Python floor and Worker build, and #1537's merge fixes its ts stub for #1537's storage template step, so this merge needs no resolution.
|
For the identity integration branch (#1608), I pushed |
…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`.
|
For the identity integration branch (#1608), I pushed |
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.
|
For the identity integration branch (#1608), I pushed 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 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.
|
Review feedback is addressed in 0bab84b, which sits on the latest #1623 merge ( @dhruv8sh: getting-started still used removed inputs (blocking). Fixed. @aram356: review-level items
@prk-Jr: P1 lazy Checks on 0bab84b: |
prk-Jr
left a comment
There was a problem hiding this comment.
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_asyncin the native bridge (outbound.rs): no longer in this PR. The head has no TS outbound bridge.platform.rstakesrequest_outbound_clientfrom core, and native dispatch is now EdgeZero'sstart_batch_until. At pin1619078athat callsschedule_batch→spawn_ownedon the outbound executor (source read; not re-probed). Any dispatch-timing question now belongs with the base chain or EdgeZero, not this PR.
- 🔧 Getting-started used removed inputs: resolved.
getting-started.mdand.env.examplenow useEDGEZERO__ADAPTER__CONFIG_DIRandEDGEZERO__SECRETS__*. I checked that EdgeZero at the pin honours the documented__KEYoverride (store_key) and the uppercase secret mapping (secret_env_var).ts config push --adapter axumalready 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_targetcovers it. - ⛏
reserve_portcomment: resolved in both test files.
@aram356 (blocking items still in scope)
- macOS gateway-isolation test: resolved. No
127.0.0.2/.3binds 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.tomland 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.mdrewrite is partly addressed, and the author has deferred the rest. I'm fine with that.
Verification
cargo test-axum --all-featuresat this head on aarch64-apple-darwin: lib 23,native_acceptance10 passed + 1 ignored (the Linux-only reflexive-connect test is compiled out on macOS),routes43,startup8. 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.mjsand 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
| ).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", |
There was a problem hiding this comment.
🤔 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); |
There was a problem hiding this comment.
🌱 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
left a comment
There was a problem hiding this comment.
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.tomlby a test:handwritten_store_metadata_matches_the_manifestfails if the handwrittenstores()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())) |
There was a problem hiding this comment.
🤔 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( |
There was a problem hiding this comment.
🤔 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 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.
|
Round 12 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
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.
|
Round 15 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
|
Round 17 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1623's new head ( Checks on this head: no conflict markers; |
|
Pushed fixes for findings from the #1608 review that trace to this PR, one commit per finding:
The head then merges #1623's new head, which carries the fixes from lower in the stack. |
Summary
TRUSTED_SERVER_CONFIG_*andTRUSTED_SERVER_SECRET_*variables andPORTare no longer read. Local runs useEDGEZERO__ADAPTER__CONFIG_DIRandEDGEZERO__SECRETS__<KEY>. Optional features add the AWS AppConfig Agent and Secrets Manager providers.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
crates/trusted-server-adapter-axum/src/startup.rsrequest_signing.enabledand 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.rsrun_production_app_with_initializerwith the TS initializer. Writes startup failures to stderr when no logger is installed yet.crates/trusted-server-adapter-axum/src/app.rscrates/trusted-server-adapter-axum/src/platform.rscrates/trusted-server-adapter-axum/Cargo.tomlaws-appconfig-agentandaws-secrets-managerfeatures, both off by default, and EdgeZero'snative-bindings. Updates dev-dependencies.crates/trusted-server-core/src/config_payload.rs,secret_resolution.rsVerifiedConfigBlobverifies 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.rscrates/trusted-server-core/src/integrations/datadome/protection.rscrates/trusted-server-adapter-axum/tests/startup.rs,native_acceptance.rs,fixtures/native/crates/trusted-server-integration-tests/tests/,crates/trusted-server-adapter-axum/tests/routes.rs,scripts/smoke-axum.shEDGEZERO__SECRETS__*values.scripts/test-native-providers.mjs,scripts/tests/test-native-providers.test.mjs.github/workflows/format.ymldocs/guide/getting-started.md,docs/guide/axum-dev.md,docs/guide/native-rc-demo.md,crates/trusted-server-adapter-axum/README.md,.env.exampleOut 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-featurescargo test -p trusted-server-core --lib datadomecargo clippy-axum && cargo clippy-fastlycargo fmt --all -- --checknode --test scripts/tests/test-native-providers.test.mjsnode scripts/test-native-providers.mjs <binary>with--features aws-appconfig-agent,aws-secrets-managerpasses config-only, secret-only and combined modes, including the provider-failure causes. It contacts no AWS account./healthcargo test-fastly, the other adapter suites, and the JS and docs format checks are left to hosted CIreal_nextjs_action_and_api_after_truncated_post) needs a local fixture and was not runLocal fixtures don't cover live AWS, images, fleets or publishers.
Checklist
unwrap()in production codelogmacros, apart from the documented stderr fallback for pre-logger startup failures