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.
|
At the maintainer's request, Nothing reads or writes the store in production: What changed:
Checks: The 35 PRs stacked on this one merged |
PR #1503 at 6a8797e: Add ts ec show and ts ec eids admin diagnostic commands PR #1557 at a435778: Carry Sourcepoint TCF consent to Trusted Server PR #1607 at 07086f2: Send the resolved client IP to the publisher origin PR #1627 at 5b7fc3d: Wire declared stores and document unsupported Axum KV PR #1636 at d838931: Drain Axum after-response identity tasks on SIGTERM PR #1653 at 5b86d9b: Clarify and verify the Axum local config handoff PR #1654 at be495b3: Verify pending record writes drain within shutdown grace PR #1655 at 888c5f1: Configure EC lifetime and renew it on eligible visits (DEC-13) PR #1659 at 7b1d4a7: Verify geo consent paths on Axum and Fastly PR #1660 at 64a1baa: Retry an after-response write that loses its CAS PR #1667 at 1359722: Present a client certificate on auction providers that set mtls PR #1709 at bc43a3e: Keep the EC out of bid request IDs and gate user.id on EID consent PR #1710 at dc728a1: Apply pull-sync consent checks to identify PR #1713 at ffa7597: Apply consent rules to first-party click redirects PR #1722 at 070e2b0: Use applicable GPP sections from the CMP instead of header sections PR #1666 at 4720b0b (Verify identity gates and provider deadlines on Axum) arrives through #1659, and PR #1622 at c878e6e (Report CMP consent to the EC route and merge its answer into Prebid) arrives through #1722. Every other chain PR arrives through the tips above. The tree is the conflict-free union of these tips and carries no resolution of its own.
|
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 #1637's new head ( Checks on this head: no conflict markers; |
Summary
Wire generic runtime KV through the real Fastly, Cloudflare and Spin binding paths under the separate logical ID
trusted_server_runtime_kv. Missing optional storage preserves publisher pages and returns the adapter's typed KV error. Axum generic KV remains deliberately unsupported, with prepared config/secret snapshots preserved. This infrastructure does not migrate identity records or enable Axum identity persistence;trusted_server_kvremains the separate identity direction.Revision status, checked 2026-12-03 12:13 UTC: the maintainer advanced this PR to
70f5ae3956, with basefeat/1580-runtime-env-guardat7f3a351803cb49b3e5b1aa03234eaed1eff5d04cand EdgeZeroef5cbf308. Earlier signed review correctionb1d9efaee8remains in its history. Local/runtime and hosted results below are historical for their named revisions; they do not qualify this later SDK merge. Exact-head CI reports 56 contexts (28 QUEUED, 28 SUCCESS); full current-head qualification is assessed separately.The current correction uses Spin's component-aware executor for both synchronous config and secret reads. A generic executor cannot drive a suspended WASI import: the retained 100 ms delayed-config fixture succeeds with direct await, times out through the original bridge, and completes through the corrected bridge. The synchronous platform interfaces and pinned SDK stay unchanged. Startup, request-time config and encoded component variables retain their supported paths.
Cloudflare provisioning reads the unified manifest, not the reference
cloudflare.toml. The guide now suppliesEDGEZERO__STORES__KV__TRUSTED_SERVER_RUNTIME_KV__NAME=TRUSTED_SERVER_RUNTIME_KV. An actual isolated CLI dry run proves it selects the uppercase binding the Worker opens, leaves config staging separate and changes no files. The unselected control demonstrates the lowercase logical default. No Cloudflare runtime selector, global default or namespace collision exception is introduced.Retained
store-runtimeexamples andscripts/test-runtime-stores.mjsexercise each worker adapter's actualbuild_runtime_servicesthrough genuine EdgeZero request contexts. Separate HTTP requests prove write/read/delete persistence, config separation, encoded secret access and missing-store errors while real publisher/readiness routes still work. The examples compile the production app/platform modules; their fixture routes are not in production entry points. The worker-runtime matrix now builds, lints and runs them. A separate launcher-double control verifies cleanup of owned descendants after the launcher exits.The release migration note and guides distinguish runtime storage from future identity declarations. Existing inventory plans/specs now describe the named handle lookups, current #1637 base, retained fixtures and current verification requirements; historical integration instructions remain explicitly historical.
Adapter behavior
trusted_server_runtime_kvOpenFailed; pages remain servedTRUSTED_SERVER_RUNTIME_KVUnavailable; pages remain servedtrusted_server_runtime_kvlabelOpenFailed; pages remain serveddefault; signing keys use encoded component variablesUnavailable; pages remain servedFastly generic KV must have its own physical store, separate from identity records. Existing generic links/selectors using
trusted_server_kvmove totrusted_server_runtime_kv; Cloudflare generic bindings move fromTRUSTED_SERVER_KVtoTRUSTED_SERVER_RUNTIME_KV; Spin generic grants/runtime backend labels move totrusted_server_runtime_kv. Fastly and Spin use the named handle, not a registry default that could select identity storage. Never map Spin runtime KV todefault. Cloudflare deployed app-config staging must remain separate from runtime KV; see the Cloudflare guide.Original correction base and scope
Source:
fix/1139-adapter-store-inventory. Base at the original correction’s qualification: #1637,feat/1580-runtime-env-guard, at51d468d397d1c651a00e3a03be9fe9dbc6ff93ac, independently checked then from the Git ref. The later maintainer source/base identities are recorded above. #1635's prepared startup is retained in the history. No merge, rebase, retarget, dependency-PR edit or deployment is included in this correction. Sibling combined trees have not been qualified by these individual-PR checks.Closes #1139
Current correction verification
Correction b1d9efaee is signed and GitHub Verified.
All required local repository gates passed on the committed source: target-matched tests and Clippy for all adapters, CLI/codegen/parity/native build-digest checks, deadline fixtures, current-source staged/base-diff URL-host checks, script controls, JS/docs lint and formatting, docs build, and fresh production startup smokes on all four adapters. The full JS suite passes 3,318 tests, with one skipped and no TypeScript errors. Both retained store examples also build, pass target-matched Clippy and rustdoc, and execute under pinned Spin 4.1.0 / Wrangler 4.83.0. Rustdoc retains the existing Spin middleware private-link warning, repeated when documenting the shared-source example.
Runtime checks additionally verify actual discovery and positive/tampered signature requests. With a matching default-label JWK and encoded private key, an actual Spin auction reaches a local bidder and its wire signature verifies independently in Node. Removing public metadata preserves discovery/verification failures; removing the private key answers 502 before provider dispatch. Cloudflare retains its unsupported-signing responses and does not dispatch a signing-enabled auction. Current synthetic TCF consent reaches the real auction gate; validation is not bypassed.
The old Spin executor and an unavailable request-store substitute on each worker are rejected by the runtime controls. Source and artifacts were restored before final positive qualification. The suspended-read control forces a config host future to wait; it does not prove the real variable host call itself suspended. Local runtimes do not establish deployed storage behavior or identity persistence. No provisioning writes, deployment, machine trust changes or operator configuration edits were performed.
New-head hosted CI is pending. Earlier successful runs belong to their named older revisions. Three original-thread replies cover the current corrections; the threads remain open until relevant exact-head checks are confirmed. Existing reviewer approval is not a new review of this correction.
Current rework design and inventory design.
Previous PR description — historical revision-specific evidence
The revision, base, temporary-probe, merge-trial and readiness statements below are historical. Current correction evidence is above; unlinked private historical receipts are not reconstructed or claimed repeated.
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