Repository navigation
Name backends in each adapter - #1390
Open
jwrosewell wants to merge 46 commits into
Open
jwrosewell wants to merge 46 commits into
jwrosewell wants to merge 46 commits into
Conversation
Core held a backend naming and transport timer policy for each of the four adapters, with a variant per platform, so that startup validation, the ts command and the adapters predicted the same backend names before any was registered. The policies called no platform and still named every platform in core, where the rule is that core names none. Core keeps one interface. PlatformBackend already answered the name a backend will have and the transport timer it allows, and now also answers the backend budget and the timer bucket count that plan validation asks, with defaults for a host whose names are not a limited resource. The method that returned a platform variant is gone, with the enum, the target id enum, the predicted backend type and the naming error type. Plan validation takes an AuctionTargetDescriptor the adapter builds from its name, the backend implementation its runtime services use, and its capabilities, so the names validation predicts are the names the host registers. Each adapter carries its own policy beside the code that registers its backends: the Fastly policy sits in backend.rs next to the registration, and the Axum, Cloudflare and Spin correlation names sit in each platform.rs next to its PlatformBackend. The names a deployment sees are unchanged and each adapter pins them in a test. Core's test double names from every field of the specification and declares the budget and buckets a test gives it, so validation is driven to every refusal without a host. The ts command's one backend implements the interface alone. The design page, the auction and integration guides and the changelog say the same.
The test registered two demand sources through core's naming double and expected each backend's transport timer to be 750ms, which was one host's rounding of the 777ms auction budget. The double keeps the exact bounded value, so the timer it registers is the budget itself.
# Conflicts: # CHANGELOG.md # crates/trusted-server-adapter-fastly/Cargo.toml
The backend naming series removed the policy from the platform backend, and this double came in with the client hints series.
# Conflicts: # CHANGELOG.md # crates/auction/prebid-server/src/lib.rs # crates/trusted-server-adapter-fastly/src/tinybird.rs # crates/trusted-server-core/src/platform/mod.rs
…reaks outside core Review round 1 found that the design named the ts command as a third caller of the policy, when the command never called it and the callers were each adapter's startup validation and registration. The design now names those two callers, says that only convention keeps the backend in an adapter's descriptor the same type as the one its runtime services use, lists what breaks for crates outside core, and gives the paths with no test. The design also says what remains named in core, what the issue asks, and why the ts command cannot yet get a descriptor, corrects the pull request references, and records the review round. The auction guide said core names no platform. It now says that plan validation names none, which is the claim the code supports. The lines after that sentence are re-wrapped and carry no other change.
Review round 2 approved the design with no blocking issues and asked for four small changes. The compatibility paragraph now says the descriptor is no longer Copy, PartialEq or Eq, has no naming_policy method, has methods that take &self, and gives its name as a static string. The related pull requests line names the Tech Lab draft as well as the fork draft, and the orchestrator test is described as changing two assertions, one for each provider. The design names neither pull request for the design documents, so the fourth change needed no edit. The review log and the revision record carry the round.
jwrosewell
added this pull request to stack #1401
October 15, 2026 17:56
jwrosewell
removed this pull request from stack #1401
October 15, 2026 20:51
…a naming policy Each adapter now names its own backends and the backend trait has no naming policy, so the backend that caps the device module's transport timers no longer forwards one. It passes on the two questions the trait now asks, the auction's backend budget and the timeout bucket count, to the backend it wraps, and the test of the cap builds its naming backend with no policy.
This was referenced Oct 17, 2026
jwrosewell
added this pull request to stack #1408
October 17, 2026 09:05
`proxy.certificate_check = false` is meant for local development with a self-signed origin, and the Axum adapter, which is the local development server, ignored it in silence. Its reqwest client is built with rustls and the bundled public roots and is never told to skip verification, so the setting changed nothing there and nothing said so. The adapter now warns once at startup, where its state is built for the process, that it does not honor the setting and still verifies every HTTPS origin's certificate. The test builds the state with the check off and finds one such warning, and with the check on finds none. The configuration guide says that only the Fastly adapter honors `false`, that Axum warns, and that Cloudflare and Spin use the setting only in the name each gives a backend, because the HTTP client each platform provides takes no option to skip the check. The architecture table, the getting-started note and the Axum guide list it among Axum's limits, and the backend naming design records it. The behavior was reported in #1132.
# Conflicts: # CHANGELOG.md # crates/trusted-server-adapter-axum/src/app.rs # docs/guide/architecture.md # docs/guide/axum-dev.md
# Conflicts: # crates/trusted-server-core/src/auction/orchestrator.rs
jwrosewell
added this pull request to stack #1418
October 19, 2026 12:18
jwrosewell
removed this pull request from stack #1418
October 19, 2026 16:30
jwrosewell
added this pull request to stack #1421
October 19, 2026 17:38
jwrosewell
removed this pull request from stack #1421
October 19, 2026 18:29
jwrosewell
added this pull request to stack #1422
October 19, 2026 19:20
jwrosewell
marked this pull request as ready for review
October 19, 2026 20:24
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
crates/trusted-server-core/srccrates/trusted-server-adapter-fastly/srccrates/trusted-server-adapter-axum/srccrates/trusted-server-adapter-cloudflare/srccrates/trusted-server-adapter-spin/srcdocs/superpowersdocs/guidecrates/auction/apscrates/analytics/tinybirdcrates/trusted-server-adapter-axum/testscrates/trusted-server-cli/srcCHANGELOG.mdcrates/shared/51degreescrates/testing/iabtlCargo.lockcrates/auction/prebid-servercrates/trusted-server-adapter-fastly/Cargo.tomlCloses
Closes #1339
Spec
Spec: backend-naming
Test plan
CI on this pull request at 3af8768 passed all 26 checks.
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute serveChecklist
unwrap()in production code (clippy deniesunwrap_usedin CI)logmacros as AGENTS.md asks (notprintln!)On top of the last names series (#1389). Issue: #1339.
What this adds
What changes.
Each adapter names its own backends. Core's
platform/backend_naming.rs, with a naming and transport timeout policy for each of the four adapters, is gone. ThePlatformBackendinterface core already asked for a backend's name and timer now also answers the auction backend budget and the transport timeout bucket count, and an auction plan is validated against a descriptor the adapter builds from that same implementation, so a policy and the registration it predicts cannot drift apart.How it works.
PlatformBackendgains two defaulted methods, the enum of platform policies and the structs beside it are deleted, andAuctionPlan::validate_for_targettakes anAuctionTargetDescriptorthe adapter builds from its backend implementation and its capabilities.backend.rsbeside the registration that uses them, with its platform backend delegating to them, and the Axum, Cloudflare and Spin adapters each hold abackend_namebeside their platform backend. The names a deployment sees are unchanged and each adapter pins them in a test.Why
Core names no hosting platform. These policies were kept in core so that startup validation and the adapters agreed, and the interface gives the same agreement without the names.
What breaks
Nothing for a deployment. The names predicted are the same, from the adapter that registers them. A crate outside core that built a
BackendNamingPolicybuilds a descriptor from its platform backend instead.The commits
How it was verified
Each adapter pins the backend names it predicts in a test.