Skip to content

Define platform traits, ClientInfo, PlatformError, RuntimeServices #483

Closed

Description

@aram356

Description

Create platform/ module in core crate with all platform trait interfaces (PlatformConfigStore, PlatformSecretStore, PlatformKvStore, PlatformBackend, PlatformHttpClient, PlatformGeo), ClientInfo struct, PlatformError enum, and RuntimeServices struct. Wire async_trait with target-conditional ?Send on wasm.

ClientInfo (extract-once pattern)

ClientInfo is a plain data struct, not a trait. Each adapter constructs it once at the entry point from the platform request (before dispatching to handlers) and stores it in RuntimeServices. Handlers read it from there — no request parameter needed. This follows the existing GeoInfo::from_request() pattern.

pub struct ClientInfo {
    pub client_ip: Option<IpAddr>,
    pub tls_protocol: Option<String>,
    pub tls_cipher: Option<String>,
}

RuntimeServices stores it as pub client_info: ClientInfo (not Box<dyn ...>).

PlatformHttpClient and EdgeZero ProxyClient

PlatformHttpClient is a superset of EdgeZero's existing ProxyClient (sync send + async fan-out via send_async + select, backend correlation, WASM-compatible). These must not coexist as parallel abstractions. File an EdgeZero issue to generalize ProxyClient into an HttpClient trait before PR 6 merges. During Phase 1, the trusted-server defines its own PlatformHttpClient backed by Fastly SDK calls; when EdgeZero's generalized HttpClient lands, swap to implementing that trait instead.

Done when

  • Traits compile on host + wasm
  • Object-safety static assertion + dummy RuntimeServices unit test pass
  • async_trait wired with target-conditional Send
  • ClientInfo struct defined
  • Per-PR gates pass

Blocked by

PR 1

References

Activity

  1. self-assigned this
    on Mar 12, 2026
  2. added theissue type on Mar 12, 2026
  3. changed the title [-]EZ PR 2: Define platform traits, PlatformError, RuntimeServices[/-] [+]Define platform traits, PlatformError, RuntimeServices[/+] on Mar 12, 2026
  4. removed their assignment
    on Mar 13, 2026
  5. changed the title [-]Define platform traits, PlatformError, RuntimeServices[/-] [+]Define platform traits, ClientInfo, PlatformError, RuntimeServices[/+] on Mar 17, 2026
  6. self-assigned this
    on Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions