pub trait WebhookConfigSource: Send + Sync {
// Required method
fn mutating_configs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn validating_configs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Source of the live MutatingWebhookConfiguration objects. Production reads
the store; tests pass a static list. Returns the raw opaque-JSON config
objects (the plugin parses them into MutatingWebhooks) — so the source
stays a thin “give me the configs” seam with no parsing logic to drift.
Required Methods§
Provided Methods§
Sourcefn validating_configs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validating_configs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Every live ValidatingWebhookConfiguration object, as stored JSON.
★ WHY A SEPARATE ARM AND NOT A REUSE OF THE MUTATING ONE. The two kinds are stored separately, called at different points in the pipeline, and mean different things: a mutating webhook may REWRITE the object, a validating one may only accept or reject it. Serving validating configs from the mutating list would let a policy webhook silently rewrite objects, which is precisely the privilege the split exists to withhold.
Defaulted to empty so every existing implementor keeps compiling and behaves exactly as before — an implementor that has not yet been taught about validating webhooks reports none, rather than accidentally reporting the mutating ones.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".