Skip to main content

hyperlane_plugin_security/
trait.rs

1use super::*;
2
3/// Extensible request inspection rule evaluated before routing.
4pub trait SecurityRule: Send + Sync + 'static {
5    /// Inspects `ctx` and returns `Err(SecurityViolation)` to block the request immediately.
6    ///
7    /// # Arguments
8    ///
9    /// - `&Context` - Incoming request context.
10    ///
11    /// # Returns
12    ///
13    /// - `Result<(), SecurityViolation>` - `Ok(())` to permit, or violation details to reject.
14    fn inspect(&self, ctx: &Context) -> Result<(), SecurityViolation>;
15}