hyperlane-plugin-auth 23.1.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
//! hyperlane-plugin-auth
//!
//! Pure-Rust high-performance authentication and RBAC plugin for Hyperlane
//! with HS256 JWT (`kid` rotation, `exp`/`nbf`/`iss`/`aud`), API key and
//! HTTP Basic authenticators, constant-time verification, and extensible
//! async [`Authenticator`] traits.

mod r#const;
mod r#enum;
mod r#fn;
mod r#impl;
mod r#static;
mod r#struct;
mod r#trait;
mod r#type;

#[cfg(test)]
#[path = "../tests/mod.rs"]
mod tests;

pub use {r#const::*, r#enum::*, r#fn::*, r#struct::*, r#trait::*, r#type::*};

pub(crate) use r#static::*;

#[cfg(all(target_arch = "aarch64", target_endian = "little"))]
use std::arch::{
    aarch64::{
        uint8x16_t, uint32x4_t, vaddq_u32, vdupq_n_u8, veorq_u8, vld1q_u8, vld1q_u32,
        vreinterpretq_u8_u32, vreinterpretq_u32_u8, vrev32q_u8, vsha256h2q_u32, vsha256hq_u32,
        vsha256su0q_u32, vsha256su1q_u32, vst1q_u8, vst1q_u32,
    },
    is_aarch64_feature_detected,
};

use std::{
    borrow::Cow,
    collections::{HashMap, VecDeque},
    error::Error,
    fmt::{self, Display, Formatter},
    future::Future,
    io::{self, Write},
    pin::Pin,
    str::from_utf8,
    sync::{Arc, OnceLock},
    time::{Duration, SystemTime, UNIX_EPOCH},
};

use {
    hyperlane::{
        AUTHORIZATION, Context, HashMapXxHash3_64, HashSetXxHash3_64, HttpStatus, Request,
        Response, ResponseError, ServerHook, Status, Stream, WWW_AUTHENTICATE, X_API_KEY,
        hash_map_xx_hash3_64, hash_set_xx_hash3_64,
    },
    lombok_macros::*,
    serde::{
        Deserialize, Deserializer, Serialize, Serializer,
        de::{self, MapAccess, Visitor},
        ser::SerializeMap,
    },
    serde_json::{Value, from_slice, to_vec, to_writer},
};