hyperlane-plugin-auth 22.10.0

A zero-external-crypto-dependency authentication and RBAC plugin for the Hyperlane framework providing pure-Rust HS256 JWT with kid rotation, API key and HTTP Basic authenticators, extensible async Authenticator traits, and constant-time verification.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

/// Pluggable asynchronous authenticator resolving a Hyperlane [`Context`] into an [`AuthPrincipal`].
pub trait Authenticator: Send + Sync + 'static {
    /// Authenticates the incoming request represented by `ctx`.
    ///
    /// # Arguments
    ///
    /// - `&'a self` - Shared reference to self.
    /// - `&'a Context` - Incoming request context.
    ///
    /// # Returns
    ///
    /// - `AuthFuture<'a>` - Future resolving to the verified [`AuthPrincipal`] or [`AuthError`].
    fn authenticate<'a>(&'a self, ctx: &'a Context) -> AuthFuture<'a>;
}