Expand description
WASM Plugin System
Feature 11: Extensible plugin system using WebAssembly for safe, sandboxed, high-performance extensibility.
§Overview
The WASM plugin system enables custom:
- Authentication schemes
- Query transformations
- Caching strategies
- Routing decisions
- Metrics collection
§Architecture
┌─────────────────────────────────────────────────┐
│ WASM PLUGIN RUNTIME │
│ ┌──────────────────────────────────────────┐ │
│ │ Plugin Manager │ │
│ │ - Load/unload plugins │ │
│ │ - Version management │ │
│ │ - Health monitoring │ │
│ └──────────────────────────────────────────┘ │
│ ┌─────────────────┬─────────────────┐ │
│ │ Plugin A │ Plugin B │ │
│ │ (.wasm) │ (.wasm) │ │
│ └─────────────────┴─────────────────┘ │
│ ┌──────────────────────────────────────┐ │
│ │ Host Functions (Secure API) │ │
│ │ - Query execution │ │
│ │ - Cache access │ │
│ │ - Metrics / Logging │ │
│ └──────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘Re-exports§
pub use config::PluginRuntimeConfig;pub use config::PluginRuntimeConfigBuilder;pub use config::PluginConfig;pub use runtime::WasmPluginRuntime;pub use runtime::LoadedPlugin;pub use runtime::PluginState;pub use runtime::PluginError;pub use loader::PluginLoader;pub use loader::PluginManifest;pub use loader::PluginLoadError;pub use loader::SignatureVerifier;pub use host_functions::HostFunctionRegistry;pub use sandbox::PluginSandbox;pub use sandbox::SecurityPolicy;pub use sandbox::Permission;pub use sandbox::ResourceLimits;pub use hot_reload::HotReloader;pub use hot_reload::ReloadEvent;pub use hot_reload::ReloadError;pub use metrics::PluginMetrics;pub use metrics::PluginStats;pub use metrics::HookLatency;
Modules§
- config
- Plugin Configuration
- host_
functions - Host Functions
- host_
imports - Wasmtime-side host imports exposed to WASM plugins.
- hot_
reload - Hot Reload Support
- loader
- Plugin Loader
- metrics
- Plugin Metrics
- runtime
- WASM Plugin Runtime
- sandbox
- Security Sandbox
Structs§
- Auth
Request - Authentication request
- Hook
Context - Hook context passed to plugins
- Identity
- User identity from authentication
- Plugin
Info - Plugin information for listing
- Plugin
Manager - Plugin manager for coordinating all plugins
- Plugin
Manager Metrics - Plugin manager metrics
- Plugin
Metadata - Plugin metadata
- Post
Query Outcome - Outcome passed to post-query hooks.
- Query
Context - Query context for query-related hooks
Enums§
- Auth
Result - Result of authentication hook
- Hook
Type - Hook types supported by plugins
- PreQuery
Result - Result of a pre-query hook
- Route
Result - Result of routing hook