Skip to main content

Module host_services

Module host_services 

Source
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§

HttpResponse
Response returned by an HttpEgress request.

Enums§

HttpPolicyError
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§

HttpEgress
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 >= 400 status gate.
resolve_http_timeout
Resolve the per-call HTTP timeout from the granted capabilities.