Repository navigation
Conversation
Every adapter manifest declared `trusted_server_kv`, but each adapter handed core an unavailable KV store. Cloudflare and Spin also served request-time config from a no-op store, so Spin's documented request-signing metadata in the `default` label was unreachable. - Fastly uses the KV handle EdgeZero registers for the declared store. - Cloudflare opens the `TRUSTED_SERVER_KV` binding per request; request signing stays unsupported there and is documented with its results. - Spin declares only the KV store (label `trusted_server_kv`) and reads request-time config from `default`, the label startup reads. - Axum opens an opt-in file store at `TRUSTED_SERVER_KV_PATH`, running its synchronous I/O on Tokio's blocking pool. - A missing binding never fails startup or routing: KV operations return a typed error. Core gains one shared `KvHandleStore` bridge in place of the adapters' private copies. The guides gain a full store inventory, stale adapter statements are corrected, and dead local fixture stores are removed. Refs #1139
- Axum's runtime KV store now sits behind a KvHandle, so key, value and TTL limits match the other adapters, and it opens during startup instead of on the first request. - The local counter_store KV entry backed nothing: FastlyRateLimiter opens an Edge Rate Limiting counter, which Viceroy stubs. Remove it and correct the inventory. - Add a Spin CI test that signs an auction request with the metadata in `default` and the private key in its encoded component variable. - Correct inventory rows, the Cloudflare guide and a test comment, and link the request-signing guide to the store inventory. Refs #1139
Brings #1635, which now carries the identity integration chain (dhruv8sh's spine with the core identity app, the protected native Geo from #1532, the identity conformance suite from #1613, the certificate-check statement from #1616, the health and startup-failure contract from #1617 applied to the native production runner, and the creative-proxy identity disclosure policy from #1615), into the adapter store inventory. Fastly app: the PR's per-request generic KV store helper stays next to the base's publisher_fallback_methods, which the startup failure responses share. Adapter READMEs: each keeps the PR's store statements (Axum's unavailable generic KV with no adapter-local store, Cloudflare's per-request TRUSTED_SERVER_KV binding and missing request-time config store, Spin's default label and opt-in trusted_server_kv label) and the base's sentence that /health, /ready and startup failures follow the operational probe contract. The PR's statements that Cloudflare has no /health route and that a Spin startup failure answers /health with 503 go, because the base serves the probes. API reference: the dispositions paragraph keeps the PR's Cloudflare discovery and verification note and the base's failure-router wording, without the PR's "exits with status 1" disposition and Axum exit, which the base's contract replaced. Spin guide: the PR's runtime boundaries for the default label, encoded signing keys and the opt-in KV label stay, followed by the PR's integration CI note and the base's health and startup smoke note in place of the PR's manual smoke sentence. Cloudflare guide: the smoke instructions keep the base's Wrangler pin, so the PR's note that the stack has no pin goes. Cargo.lock is the base's.
|
For the identity integration branch (#1608), I pushed
|
Rename the generic runtime KV store's logical ID to trusted_server_runtime_kv (Cloudflare binding TRUSTED_SERVER_RUNTIME_KV) so trusted_server_kv stays reserved for the identity record store. Fastly and Spin now look the generic store up by its ID instead of the registry default, so declaring the identity store cannot redirect generic writes.
#1627 now stacks on #1637 instead of #1635, as the last of the Axum serving tips. This merge brings #1637 (0f206e4), which guards serving runtime environment names, and #1635's new head through #1637's merge of it (f4201b3). It also brings, through the chain's merges into #1635 and below, 1f054c6 from #1488, which forwards ortb2.user.ext.eids from the Prebid config into the auction EIDs; 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; and 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 merge had no conflicts. The base now also carries #1506's repin of EdgeZero to rc/identity at d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. docs/guide/architecture.md conflicts in the Axum limitations table, which #1617's 6d174a8 rewraps with a new Startup failure row. The merge keeps this PR's KV store row and takes #1617's Startup failure row.
The Spin discovery test read the response body as text and passed it to serde_json::from_str, which CodeQL reports as deserializing remote data. It now asserts the status and decodes with Response::json, as the other discovery and verification tests in this file do. The document comes from the test's own local Spin server either way; the kid assertion message now prints the decoded document instead of the raw body.
This brings #1625 (006b45e): c2653f7, which pins Wrangler for the Cloudflare smoke and CI, and e094788, which keeps the pinned tools throughout the smoke. #1627 already carries #1506's new head, which #1625 merges, so only #1625's own two commits arrive. The held PRs above #1627 then carry both, and rc/identity no longer combines them. Cloudflare guide: e094788 adds to the smoke paragraph that the smoke copies the tool version declarations into its workspace, and this PR's 4d0c1a2 renames the binding in the same sentence to TRUSTED_SERVER_RUNTIME_KV. The merge keeps both: the tool version clause and the TRUSTED_SERVER_RUNTIME_KV binding. scripts/smoke-cloudflare.sh merges without conflicts and uses TRUSTED_SERVER_RUNTIME_KV throughout. Cloudflare smoke test: #1625's scripts/smoke-cloudflare.test.mjs, which CI runs in worker-auction-deadlines.yml, was written against main's smoke script. #1617's dba90aa, which this PR carries, makes the smoke run `python3 -c` for its 3.11 floor and build the Worker unless CLOUDFLARE_BUILD_PATH names a prebuilt bundle, so five of the six tests failed: the python3 stub exits 99, and the fixture's empty build/index.js no longer skips the build. The fixture's python3 stub now passes only the `-c` probe, and the run hands CLOUDFLARE_BUILD_PATH the fixture's build directory. All six tests pass.
This brings in 1f054c6 from #1488, which forwards ortb2.user.ext.eids from the Prebid config into the auction EIDs, and a99dd66, a62601b, d1eb75f and 394892b from #1489, which cap mirrored UID expiry at 30 days from the UTC day start and pass the request time into finalize. They arrive through the chain's merges into #1639, #1640, #1612, #1628, #1623, #1531, #1532, #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646, with #1646's move of the request time into IdentityApp::finalize. It also brings d5276ee, which publishes the native AWS runtime files without GNU mv -T, and Christian's merge 5597d3e of #1538 into #1540, through #1566's merge. The base now also carries the Axum serving line (#1613, #1616, #1617, #1615, #1635, #1637 and #1627), which #1533 merged, and #1627's b958107, which decodes the Spin discovery document with Response::json, and #1627's merge of #1625 (006b45e), which pins Wrangler for the Cloudflare smoke and CI. This PR already carries #1646's head 461aa0d, so the merge adds only #1646's new merge 166944769 of #1642 and the chain below it, including the identity conformance check that now strips the mirrored UID's exp. It also brings b2d4bfd from #1488, which records the known UID hashes on lookup results with a setter, so the provider IDs the write planner logs are not derived from them. Restacking on the Axum serving line conflicts in the Axum startup tests, where #1617 waits for /ready, since liveness stays up after a caught initialization failure, and this PR rewrites the wait to retry a port collision and to require the child's own ready lifecycle event. Axum startup tests: wait_ready keeps this PR's collision retry and lifecycle check, then probes #1617's /ready and returns the /health response once the child is ready. The fixture drains each child's output through this PR's log readers, so #1617's assert_serves_failure_router reaps the stopped child and reads those captured logs instead of collecting the pipes, which the readers already own. The base now also carries #1506's repin of EdgeZero to rc/identity at d063a8e7 and its merge of main's Fastly SDK 0.13.3 upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. This PR now stacks on #1661 instead of #1646, so rc/identity can take both as plain merges. #1661 sits on #1656 and #1626, which sit on #1646, so the merge also brings #1626 (provider opt-outs and legacy EID expiry on Fastly and Axum), #1656 (the configurable Edge Cookie browser gate) and #1661 (refusing EC creation when a trusted JA4 contradicts the User-Agent). Fastly identity conformance fixture: #1661 records each scenario's runtime TLS JA4 through a RuntimeTlsJa4 middleware in place of derived device signals, takes the User-Agent from the scenario and drops the browser flag. This PR adds geo consent requests with their own trusted client IP settings and no browser device signals. The merge assembles the conformance app with #1661's middleware and keeps this PR's geo_configured flag and producer_settings. It sends the scenario's User-Agent unless the API request supplies one, and inserts the scenario's JA4 only for requests without a geo consent exchange, because this PR derived device signals only for those. The base now also carries #1627's 4d0c1a2, which renames the generic runtime KV store to trusted_server_runtime_kv, #1488's a610152 and 9104fd3, which add hashed-email intake for the LiveRamp and ID5 identity providers, #1646's aa31559, which gates identity writes for rejected clients, and #1626's d07f789, which withholds a mirrored UID while another source owner is opted out. Fastly conformance JA4: the rebuilt #1661 merge supplies a trusted Python JA4 behind the Chrome User-Agent for #1646's known non-browser API requests, and this PR inserts the scenario's JA4 only without a geo consent exchange, with its producer_settings. The merge keeps both: a known non-browser request gets the Python JA4, any other request the scenario's JA4 unless it is a geo consent exchange. This PR's head moves to e8015ca, its clean merge of #1646's aa31559, which the base already carries, so it adds no change beyond the base. Axum lib.rs: the base now carries #1636, through #1626's merge of it, whose after_response_drain_tests module sits where this PR adds its geo_conformance module. The crate keeps both test modules.
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
I changed the base to |
|
For the identity integration branch (#1608), I pushed |
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
This PR moves generic runtime KV to a new logical ID, trusted_server_runtime_kv:
- Fastly and Spin:
RuntimeServices::kv_store()looks up the declared store by that ID. When a request has no registry, Fastly falls back to the AppState store. - Cloudflare: it opens the renamed
TRUSTED_SERVER_RUNTIME_KVbinding directly. Request-time config is now an explicit no-op. - Spin: request-time config reads the
defaultlabel. - Axum: KV is still unavailable, and the docs now say so.
- Shared code: the duplicate KV bridges in each adapter are replaced by a single
KvHandleStore.
New tests cover the bridge's validation order, Fastly writes reaching the declared store, the fallback path, and Cloudflare manifest/binding alignment. The logic looks correct and nothing blocks merging. There are two non-blocking notes below.
Cross-cutting / body-level findings
- 📝 Upgrade note: deployments need config changes — This has no single line to anchor to. Existing Fastly services that set
EDGEZERO__STORES__KV__TRUSTED_SERVER_KV__NAMEmust also set the new..._TRUSTED_SERVER_RUNTIME_KV__NAME, or the managed deploy will stop. Cloudflare deployments must rename their KV binding toTRUSTED_SERVER_RUNTIME_KV. The Fastly guide covers the Fastly case. Consider adding the Cloudflare binding rename to the release notes too. - ⛏ Docs still call
trusted_server_kv"the declared logical store" — This line is outside the diff, so it can't take an inline comment.docs/guide/axum-dev.md:1813callstrusted_server_kv"the declared logical store", but this PR removes it from every declaration.edgezero.toml, the Fastly/SpinHooks::stores(), andcloudflare.tomlnow declare onlytrusted_server_runtime_kv. An operator reading this could expecttrusted_server_kvto be linked or provisioned today. Suggest rewording to something like "will use a separate logical store,trusted_server_kv, to be declared in #1587". The same applies to the paragraph after the store inventory table indocs/guide/edgezero.md.
CI Status
- integration tests (Fastly EC lifecycle): PASS
- integration tests: PASS
- ts dev lint domains (changed lines): PASS
- vitest: PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- cargo test (cross-adapter parity): PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- CLAUDE.md symlink guard: PASS
- format-docs: PASS
- CI Node pin guard: PASS
- Fastly response diff script: PASS
- trace runtime and browser acceptance: PASS
- browser integration tests: PASS
- health-startup (axum): PASS
- Native provider acceptance script: PASS
- health-startup (cloudflare): PASS
- health-startup (fastly): PASS
- release scripts: PASS
- cargo fmt: PASS
- worker-deadlines (spin): PASS
- HTML EOF runtime (Fastly): PASS
- prepare integration artifacts: PASS
- docs-proposal scripts: PASS
- worker-deadlines (cloudflare): PASS
- cargo test (axum native): PASS
- cargo test: PASS
- health-startup (spin): PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- format-typescript: PASS
- cargo test (ts CLI, native) (macos-latest): PASS
|
For the identity integration branch (#1608), I pushed Takes #1637's new head 8eb716c, 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). The merge is clean. Takes #1625's new head 92e9b16, 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). The merge is clean. |
| .unwrap_or_else(|| Arc::new(NoopConfigStore)); | ||
| #[cfg(all(feature = "spin", target_arch = "wasm32"))] | ||
| let config_store: Arc<dyn PlatformConfigStore> = | ||
| Arc::new(ConfigStoreHandleAdapter(ConfigStoreHandle::new(Arc::new( |
There was a problem hiding this comment.
P2 · Use a component-aware wait for Spin request config. This makes ConfigStoreHandleAdapter::get() reachable from discovery, signature verification, and outbound signing. At line 88 it uses futures::executor::block_on, which does not drive WASI completion when an async host call suspends. On Spin 4.1.0 with the pinned SDK, a synthetic 100 ms WASI operation timed out after 2 seconds with that executor; direct .await and spin_sdk::wit_bindgen::block_on both completed. The SQLite smoke passed; I did not reproduce a stall in a Trusted Server request. Please await the store read or use the component-aware wait in the bridge, and add a check where the store read actually suspends.
| [stores.kv] | ||
| ids = ["trusted_server_kv"] | ||
| default = "trusted_server_kv" | ||
| ids = ["trusted_server_runtime_kv"] |
There was a problem hiding this comment.
P2 · Provision the Cloudflare binding the Worker actually opens. With ts built from this head, ts provision --adapter cloudflare --dry-run selected lowercase trusted_server_runtime_kv. The Worker opens only TRUSTED_SERVER_RUNTIME_KV, and the mapping in the reference cloudflare.toml is not used by provisioning. The default command can create a second namespace and leave the uppercase placeholder untouched. Setting EDGEZERO__STORES__KV__TRUSTED_SERVER_RUNTIME_KV__NAME=TRUSTED_SERVER_RUNTIME_KV made the dry-run select the right binding. Please document that selector, or add a Cloudflare-scoped default here. If adding the default, move the smoke's config staging to a separate binding: the CLI rejected the shared name and accepted distinct names.
| .collect::<Vec<_>>(); | ||
|
|
||
| assert!( | ||
| bindings.contains(&trusted_server_adapter_cloudflare::platform::CLOUDFLARE_KV_BINDING), |
There was a problem hiding this comment.
Test request · Exercise generic KV through the real Worker and Spin request services. This test checks binding names, and the Cloudflare smoke reads KV through Wrangler rather than the Worker. Spin's runtime signing tests use the default config label, not the generic KV label. Both suites could stay green if the request service always returned UnavailableKvStore. Could we keep a test-only runtime check that reads back a write through each adapter's RuntimeServices::kv_store() and checks the documented error when its binding is absent? No production route is needed.
Summary
trusted_server_runtime_kv. Missing optional bindings return typed errors while publisher pages remain available.KvError::Unavailable) until One record backend over EdgeZeroKvStore; delete the Fastlyec_kv.rs#1587 → Identity on Axum through T21's shared app #1574 deliver identity storage through EdgeZero's declared store. The base already has no adapter-local Axum store; this PR pins that with context read/write tests and a once-per-process warning check, and preserves prepared-store production startup from Finish Axum production startup on the native baseline #1635.default, matching startup. Correct the inventory, deployment guides and unsupported signing contracts; remove dead local fixture declarations.Stack: merged
feat/1573-axum-production-serving(#1635), preserving history without rebasing. This base supplies the production prepared config/secret startup that Axum will ship. Retarget to its successor after the base merges.Maintainer decision: keep
trusted_server_kvfor identity storage, which needs a declared store; Axum remains unsupported until #1574, after #1587 supplies the shared backend. Generic runtime KV is wired under a separate logical ID,trusted_server_runtime_kv(Cloudflare bindingTRUSTED_SERVER_RUNTIME_KV), so generic KV writes can never land in identity records. #1646 declarestrusted_server_kvas the identity record store. This PR adds generic KV infrastructure; it does not migrate Fastly identity records or enable Axum identity persistence. The pinned EdgeZero already provides native record operations, so no EdgeZero implementation is included or required here.Behavior by adapter
trusted_server_runtime_kvKvError::OpenFailed; pages servedTRUSTED_SERVER_RUNTIME_KVbindingKvError::Unavailable; pages served500, verification200 verified:falsetrusted_server_runtime_kvlabel, opened lazilyKvError::OpenFailed; pages serveddefault; private signing keys use encoded component variablesKvError::Unavailable; pages servedFastly generic KV must have a dedicated physical store, separate from identity records. Operators who linked a store under
trusted_server_kvfor generic KV, or setEDGEZERO__STORES__KV__TRUSTED_SERVER_KV__NAME, must relink it undertrusted_server_runtime_kv(EDGEZERO__STORES__KV__TRUSTED_SERVER_RUNTIME_KV__NAME); Cloudflare deployments rename theTRUSTED_SERVER_KVnamespace binding toTRUSTED_SERVER_RUNTIME_KV; Spin components that granted thetrusted_server_kvlabel rename it totrusted_server_runtime_kvinkey_value_storesand the runtime config. Fastly and Spin look the generic store up by this ID rather than as the registry default, so a later identity store declaration cannot redirect generic writes. Spin's KV label override must not point todefault. Cloudflare app-config publication must use a separate namespace from runtime KV.Trial merges at the current heads conflict with sibling #1622, #1626, #1636 and #1646 (#1636 and #1646 in the Axum README,
architecture.md,axum-dev.md,fastly.tomlandtrusted-server.example.toml). #1617's newest commit6d174a883is not yet merged up the chain and conflicts with this branch indocs/guide/architecture.md. Merges with #1620 and #1637 are clean. Individual PR checks do not qualify the combined tree.Changes
trusted-server-core/src/platform/{kv,mod}.rsKvHandleStorebridgesrc/app.rs,fastly.toml, integration Viceroy fixtures/config testsdefault; test discovery, signed auction and cryptographic verificationedgezero.toml,fastly.toml,cloudflare.toml,wrangler*.toml,spin.toml,scripts/smoke-cloudflare.shtrusted_server_runtime_kv/TRUSTED_SERVER_RUNTIME_KVCloses
Closes #1139
Spec
Rework design and store inventory design. The rework spec/plan received independent reviews; all blocking and optional findings were resolved before implementation.
Review status
Independent review of the complete PR and its final documentation corrections
was completed at
b093392a88b2ee251a17dfe950c4b1e38af4152f, then based on #1635 at6949eea868adc9427f965f984d9ea049e4b36f69, with no outstanding blocking oroptional findings. Since then the branch merged #1635 twice and added
4d0c1a2cf(generic store renamed totrusted_server_runtime_kv). The currenthead is
4d0c1a2cfb4da6cf1be416b59bca261c66fbc4cb, based on #1635 at06b40446e.Local targeted checks and the runtime verification described below are complete.
All 30 hosted checks pass on
4d0c1a2cfand the PR is no longer a draft.Combined runtime behavior with siblings has not been reverified; see the sibling
conflicts above.
Test plan
Historical results at
b55b476f9: reported executable/runtime verification (private receipts unavailable), with the final independentlyreviewed prose/doc-comment-only correction in
b093392a8. No executablebehavior changed in that final commit. Targeted verification only, per
maintainer request. Full CI gates are delegated to GitHub Actions; prior-head full-suite results are not claimed for this revision. Tools: Rust 1.98.1, Node 24.20.0, Viceroy 0.21.0, Spin 4.1.0; local Worker uses Wrangler 4.83.0 (no Wrangler pin on this stack).
Axum context-store regression: old file-enabled implementation fails (
Ok(None)instead ofUnavailable), reworked implementation passes; unavailable reads and writes tested.Axum startup subprocess tests, snapshot immutability, signing/dynamic-store rejection unit tests, and actual production-entrypoint publisher/TSJS acceptance with unavailable-KV warning.
Fastly context-store tests and shared KV bridge tests under Viceroy.
Cloudflare binding/default manifest tests, unsupported signing route test and production WASM check.
Spin declaration/config tests and production WASM build; actual
spin updiscovery and signed auction, with authentic signature accepted and tampered payload rejected.Targeted Axum and integration-test Clippy; Rust formatting and changed-document formatting.
Real local Fastly/Viceroy and Cloudflare/Worker KV round trips across separate requests; missing-binding get/put errors and publisher
200in both states. Temporary probes removed, exact source restored, artifacts rebuilt, and four publisher checks rerun.Optimized Axum production binary:
cargo test --locked --release -p trusted-server-adapter-axum --test native_acceptance prepared_envelope_serves_real_health_tsjs_and_rewritten_page -- --exact --nocapture.Spin controls on the same production component: missing encoded private key returns
502; missingdefaultmetadata makes discovery return500. The positive test oracles reject both controls.Guard serving runtime environment names #1637 compatibility: disposable merge of this candidate with
fa4a1a0(not included in this PR) passedscripts/lint-runtime-env.shon all five configurations and all 38scripts/test-runtime-env.shfixtures; merge aborted afterward.Additional actual Spin generic KV binding check at EdgeZero
9d02d7b3: cross-request put/get; absent grants returnOpenFailed; publisher pages200in both states. Separate SQLite databases confirm runtime KV does not overwritedefaultconfig. Probe removed, source restored/rebuilt, pages rechecked.Independent final review of the complete PR against Finish Axum production startup on the native baseline #1635: zero blocking code/test findings. Five optional documentation findings resolved and the exact final correction diff reviewed: ordinary-KV bridge limits, actual Fastly storage uses and Axum status, once-per-instance logging override, missing Wrangler smoke pin, and Spin private-key storage.
The former unchecked
fastly compute serveitem is covered by the explicit local Viceroy application check above: the declared store opens, writes survive into a later request, removing only its binding givesOpenFailed, and actual publisher pages still succeed.fastly compute servewas not separately invoked. This checks the runtime and bindings directly; the committed Viceroy context test additionally proves writes reach an independently opened handle.Runtime scope: Fastly/Cloudflare used dev-profile artifacts through their production entry points; Spin signing used its production release component, while its generic-KV binding probes used a dev component; Axum used its optimized production binary. No deployed-platform claim is made.
Hosted CI runs in GitHub Actions; local full CI gates were not run.
Generic KV has no normal production consumer yet. Any temporary KV probe reaches request-built services through the real runtime entry point, establishes infrastructure behavior, and is excluded from shipped source. Identity persistence is separate work. Local operator
trusted-server.toml,.envand VS Code setup remain unchanged.Checklist
unwrap()or console printing