Expand description
bestool’s canopy client: the published bes_canopy_api wire layer plus
bestool’s own HTTP transport and registration/backup helpers.
The typed CanopyClient, the CanopyTransport trait, the wire types in
schema, and the error types all come from bes_canopy_api and are
re-exported here. This crate supplies the parts specific to how bestool
reaches canopy:
ReqwestTransport, the defaultCanopyTransport, which picks canopy’s tailscale or mTLS auth path and routes calls accordingly;connectandconnect_to, which probe for an auth path and build aCanopyClientover one;registration, and the backup helpersTargetOutcomeandContainerCreds.
The transport-shaped operations — is_tailscale,
refresh, renew —
live on ReqwestTransport; reach them through
CanopyClient::transport.
§Wire types
The types in schema are generated from canopy’s OpenAPI document, which
canopy builds and publishes as bes-canopy-api. Timestamp fields are
jiff::Timestamp, credential secrets are wrapped in Redacted so they
stay out of Debug output, and each generated struct carries a builder and
is #[non_exhaustive]. CanopyClient has one method per endpoint taking
and returning these types; any non-2xx surfaces as CanopyHttpError.
Re-exports§
Modules§
- registration
- Single, machine-bound, encrypted store for this host’s canopy enrollment.
- schema
- Wire types and per-endpoint methods generated from canopy’s OpenAPI document.
Structs§
- Canopy
Http Error - A non-2xx response from a canopy endpoint.
- Container
Creds - Creds in the ECS container-credentials shape kopia’s minio-go provider polls
for: note
Token(notSessionToken), andExpirationas RFC3339Z. - Redacted
- Wraps a sensitive value so its
Debugoutput doesn’t leak the contents. - Reqwest
Transport - The default canopy transport: HTTP with auth configured for talking to a canopy server.
Enums§
- Error
- Anything that can go wrong calling canopy.
- Target
Outcome - Result of
GET /backup-target: a live target, or the benign dormant state (the device is not yet authorised for backups —412/409).
Constants§
- CERT_
RENEW_ AFTER - How long to wait between scheduled cert renewals.
- DEFAULT_
CANOPY_ URL - TAILSCALE_
URL - Base URL for the tailscale-internal canopy endpoint.
Traits§
- Canopy
Transport - The HTTP transport a
CanopyClientsends through.
Functions§
- connect
- Build a canopy client against the default public
(
DEFAULT_CANOPY_URL) and tailscale (TAILSCALE_URL) endpoints. Useconnect_toto override them. - connect_
to - Build a canopy client against explicit endpoints.
- device_
identity - Build a short-lived self-signed client certificate from a P-256 device key
PEM and wrap it as a reqwest mTLS
Identity. - tailscale_
client - Probe the canopy tailnet endpoint, returning a client routed to it if reachable.
Type Aliases§
- Canopy
Client - The typed canopy client, defaulting to bestool’s
ReqwestTransport. - Canopy
Request - A request built by
CanopyClient, ready for aCanopyTransportto send. - Canopy
Response - A response handed back to
CanopyClientby aCanopyTransport, with its body buffered. - Client
Builder Factory - Factory producing the base
reqwest::ClientBuilderfor canopy’s clients.