pub enum PluginPolicy {
Trusted {
allowlist: Vec<[u8; 32]>,
},
AllowUnsigned,
}Expand description
Trust policy governing which plugins may load.
The production path uses PluginPolicy::trusted with an explicit
allowlist of publisher verifying keys. PluginPolicy::AllowUnsigned
is the dev escape hatch — it loads anything (even unsigned modules) but
logs a loud warning per load.
Variants§
Trusted
Secure default: a plugin loads only if its module hash matches, its Ed25519 signature verifies, AND its publisher key is in this allowlist. Each entry is the 32-byte raw Ed25519 verifying key.
AllowUnsigned
Dev-only: skip signature/allowlist enforcement. Hash is still
checked when a wasm_module_hash is present (cheap integrity), but
unsigned / unknown-publisher modules are allowed. Every load logs a
loud warn.
Implementations§
Source§impl PluginPolicy
impl PluginPolicy
Sourcepub fn trusted(publisher_keys: &[&str]) -> Result<Self, PluginError>
pub fn trusted(publisher_keys: &[&str]) -> Result<Self, PluginError>
Construct the secure (production) policy from a list of trusted
publisher keys, each encoded as ed25519:<base64> (the same form
the manifest publisher_key uses).
Trait Implementations§
Source§impl Clone for PluginPolicy
impl Clone for PluginPolicy
Source§fn clone(&self) -> PluginPolicy
fn clone(&self) -> PluginPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more