Skip to main content

execute_interceptor

Function execute_interceptor 

Source
pub async fn execute_interceptor(
    plugin: &CrdPlugin,
    crd_kind: &str,
    headers: &HashMap<String, String>,
    body: &str,
    db_path: Option<&Path>,
) -> Result<()>
Expand description

Execute an interceptor plugin (e.g. custom signature verification).

The plugin receives context via environment variables:

  • PLUGIN_NAME, PLUGIN_TYPE, CRD_KIND: plugin identity
  • WEBHOOK_BODY: raw request body
  • WEBHOOK_HEADER_<NAME>: one variable per HTTP header (uppercased, hyphens→underscores)

Returns Ok(()) if the plugin exits 0 (accept), or Err if non-zero (reject).