Expand description
Host service traits for capability-gated plugin host functions.
uni.kms.* and uni.http.* host functions need a backing host service to
perform real work. These traits define that seam in the shared uni-plugin
crate so every loader (Rhai today; Extism / WASM at the host-fn cutover)
binds the same abstraction rather than each inventing its own. The host
supplies concrete implementations (e.g. a reqwest-backed HttpEgress in
uni-plugin-host) and hands them to the loader.
Secret acquisition has no trait here — it reuses
crate::secrets::SecretStore directly.
Structs§
- Http
Response - Response returned by an
HttpEgressrequest.
Enums§
- Http
Policy Error - Why a capability-gated HTTP call was refused.
Constants§
- DEFAULT_
HTTP_ TIMEOUT - Default per-call HTTP timeout when the grant carries no
Capability::WallClockMillisPerCall. - MAX_
HTTP_ RESPONSE_ BYTES - Maximum response body bytes read before truncation — bounds host memory so a hostile or oversized response cannot exhaust it.
Traits§
- Http
Egress - A blocking HTTP egress service backing the
uni.http.*host functions. - KmsProvider
- A signing / verification service backing the
uni.kms.*host functions.
Functions§
- http_
request - Run a capability-gated HTTP request: allow-list check, egress presence,
timeout resolution, dispatch, then the
>= 400status gate. - resolve_
http_ timeout - Resolve the per-call HTTP timeout from the granted capabilities.