Skip to main content

Module plugins

Module plugins 

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

AuthRequest
Authentication request
HookContext
Hook context passed to plugins
Identity
User identity from authentication
PluginInfo
Plugin information for listing
PluginManager
Plugin manager for coordinating all plugins
PluginManagerMetrics
Plugin manager metrics
PluginMetadata
Plugin metadata
PostQueryOutcome
Outcome passed to post-query hooks.
QueryContext
Query context for query-related hooks

Enums§

AuthResult
Result of authentication hook
HookType
Hook types supported by plugins
PreQueryResult
Result of a pre-query hook
RouteResult
Result of routing hook