Skip to content

Core predicts each platform's backend names #1339

Open

Description

@jwrosewell

One of the removals listed in #777.

What is wrong

crates/trusted-server-core/src/platform/backend_naming.rs holds a backend naming and transport timeout policy for each platform, with a variant for each of the four adapters, so that startup validation and the adapters predict the same backend names before any is registered. The policies call no platform, and they still name every platform in core, where the rule is that core names none.

What changes

  • Core keeps the interface. Core asks the running adapter for the name a backend will have and the timeout it allows, through one interface, and validates against the answer. Nothing in core names a platform.
  • Each adapter supplies its own policy. The Fastly adapter carries the Fastly policy, the Cloudflare adapter the Cloudflare one, the Spin adapter its own, each next to the registration code that uses it, so a policy and the registration it predicts cannot drift apart. Where EdgeZero already owns a platform's registration, the policy belongs there rather than in the adapter, and the series says which.
  • The ts command asks the adapter it is told about. Validation off the platform names the adapter whose policy applies, as it names the platform today.

Why

Core names no hosting platform. These policies were kept in core so that startup validation and the adapters agreed, and an 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.

Where it is

A series on the stack, as a draft on the fork, jwrosewell#42, on top of the last names series (fork pull request 41).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions