pub struct PluginConfig {
pub name: String,
pub wasm: Option<String>,
pub native: Option<String>,
pub source: Option<PluginSourceConfig>,
pub phases: Vec<PluginPhase>,
pub config: Option<String>,
pub limits: Option<PluginLimitsConfig>,
}Expand description
A plugin definition (DW-055 / DW-119). Each plugin is either a
proxy-wasm .wasm module loaded at startup (wasm) or a compiled-in
native Rust filter (native), run on the request pipeline phases it
declares. Routes reference plugins by name. Exactly one of wasm or
native must be set (validation enforces this).
Fields§
§name: StringUnique plugin name. Referenced by routes’ plugins field.
wasm: Option<String>Path to the .wasm module file. Must be readable at startup.
Mutually exclusive with native; exactly one of the two must be
set. Absent when this is a native filter.
native: Option<String>Registered native filter implementation name (DW-119). The
plugins cargo feature must be enabled and a factory registered
under this name at startup. Mutually exclusive with wasm;
exactly one of the two must be set. Absent when this is a WASM
plugin.
source: Option<PluginSourceConfig>SCALE-12 (#192)/DW-165: remote source for this plugin. When
set, the gateway resolves the artifact at every publish
(startup and reload): cache-first, downloading on a miss, then
verifying the mandatory SHA-256 digest and any configured
Ed25519 signature BEFORE the wasm load step. A source that
cannot be resolved or fails verification never loads (the
plugin reads Crashed; its routes fail closed). Mutually
exclusive with native and wasm. See
PluginSourceConfig and the plugin registry guide for the
cache layout and the registry spec.
phases: Vec<PluginPhase>Phases this plugin hooks. Must be a non-empty subset of:
request_headers, request_body, response_headers,
response_body. The host calls the plugin’s corresponding
proxy_on_* export at each declared phase (WASM) or the
NativeFilter trait method (native).
config: Option<String>Plugin-specific configuration, passed to the plugin’s
proxy_on_configure as a byte string (WASM) or to the native
filter’s factory (native). Typically a JSON or YAML blob the
plugin parses itself.
limits: Option<PluginLimitsConfig>Resource limits for this plugin (fuel, memory, time). Absent uses the defaults: 1M fuel, 32MB memory, 100ms timeout. Only meaningful for WASM plugins (native filters run in-process and are bounded by the gateway’s own resource limits).
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Source§fn clone(&self) -> PluginConfig
fn clone(&self) -> PluginConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginConfig
impl Debug for PluginConfig
Source§impl<'de> Deserialize<'de> for PluginConfig
impl<'de> Deserialize<'de> for PluginConfig
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 JsonSchema for PluginConfig
impl JsonSchema for PluginConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for PluginConfig
impl PartialEq for PluginConfig
Source§impl Serialize for PluginConfig
impl Serialize for PluginConfig
impl StructuralPartialEq for PluginConfig
Auto Trait Implementations§
impl Freeze for PluginConfig
impl RefUnwindSafe for PluginConfig
impl Send for PluginConfig
impl Sync for PluginConfig
impl Unpin for PluginConfig
impl UnwindSafe for PluginConfig
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more