pub struct PluginHttpPolicy {
pub allow_insecure: bool,
pub allowed_hosts: Vec<String>,
pub max_body_size: u32,
pub default_timeout_ms: u32,
pub default_follow_redirects: u32,
}Expand description
Operator-owned per-plugin policy gating outbound http-fetch
calls and bounding their body / timeout / redirect behaviour.
Plugin authors do not declare these fields — the WIT metadata
only describes the plugin’s exports. The daemon reads
<config_dir>/wasm/policy.json (top-level keys = .wasm file
stem) and constructs one PluginHttpPolicy per loaded module.
Plugins missing from the config file get PluginHttpPolicy::default
— an explicit deny-all posture (allowed_hosts empty) so an
operator who hasn’t reviewed a plugin’s network surface can’t
be surprised by it reaching out.
Fields§
§allow_insecure: boolWhen false (default), http-fetch requests with
verify_tls: false short-circuit to InsecureRejected regardless
of the per-call value.
allowed_hosts: Vec<String>Allowed-host pattern list. Each entry is either a literal
hostname ("api.internal"), a wildcard prefix
("*.example.com" matches a.example.com / b.c.example.com
but not example.com), or the universal wildcard "*". An
empty list (the default) is deny-all.
max_body_size: u32Per-request body cap (bytes) for the response body and the
outbound request body. Default 1 MiB matches
crate::fetch::HttpFetchLimits’s default max_body_bytes.
default_timeout_ms: u32Default timeout when the per-call timeout_ms is None.
Default 30 s matches the spec’s daemon default.
default_follow_redirects: u32Default redirect follow cap when the per-call
follow_redirects is None. 0 disables redirects. Default 5.
Trait Implementations§
Source§impl Clone for PluginHttpPolicy
impl Clone for PluginHttpPolicy
Source§fn clone(&self) -> PluginHttpPolicy
fn clone(&self) -> PluginHttpPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginHttpPolicy
impl Debug for PluginHttpPolicy
Source§impl Default for PluginHttpPolicy
impl Default for PluginHttpPolicy
Source§impl<'de> Deserialize<'de> for PluginHttpPolicy
impl<'de> Deserialize<'de> for PluginHttpPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PluginHttpPolicy
impl PartialEq for PluginHttpPolicy
Source§fn eq(&self, other: &PluginHttpPolicy) -> bool
fn eq(&self, other: &PluginHttpPolicy) -> bool
self and other values to be equal, and is used by ==.