Skip to main content

hyperlane_plugin_auth/
lib.rs

1//! hyperlane-plugin-auth
2//!
3//! Pure-Rust high-performance authentication and RBAC plugin for Hyperlane
4//! with HS256 JWT (`kid` rotation, `exp`/`nbf`/`iss`/`aud`), API key and
5//! HTTP Basic authenticators, constant-time verification, and extensible
6//! async [`Authenticator`] traits.
7
8mod r#const;
9mod r#enum;
10mod r#fn;
11mod r#impl;
12mod r#static;
13mod r#struct;
14mod r#trait;
15mod r#type;
16
17#[cfg(test)]
18#[path = "../tests/mod.rs"]
19mod tests;
20
21pub use {r#const::*, r#enum::*, r#fn::*, r#struct::*, r#trait::*, r#type::*};
22
23pub(crate) use r#static::*;
24
25use std::{
26    collections::HashMap,
27    error::Error,
28    fmt::{self, Display, Formatter},
29    future::Future,
30    pin::Pin,
31    str::Split,
32    sync::{Arc, OnceLock},
33    time::{Duration, SystemTime, UNIX_EPOCH},
34};
35
36use {
37    hyperlane::{
38        AUTHORIZATION, Context, HashMapXxHash3_64, HttpStatus, ResponseData, ResponseError,
39        ServerHook, Status, Stream, WWW_AUTHENTICATE, X_API_KEY, hash_map_xx_hash3_64,
40    },
41    lombok_macros::*,
42    serde::{Deserialize, Serialize},
43    serde_json::{Value, from_slice, to_vec},
44};