Expand description
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.
Structs§
- ApiKey
Authenticator - Built-in
Authenticatorvalidating static or rotated API keys from a configured header. - Auth
Config - Configuration policy for
AuthPluginandAuthHook. - Auth
Hook - Opt-in
ServerHookauthenticating incoming requests and populatingATTR_AUTH_PRINCIPAL. - Auth
Plugin - Process-wide
AuthPluginsingleton storingAuthConfigand the activeAuthenticator. - Auth
Principal - Verified caller identity attached to a Hyperlane
ContextbyAuthHook. - Basic
Authenticator - Built-in
AuthenticatorvalidatingAuthorization: Basic <base64>credentials. - Composite
Authenticator - Composite
Authenticatortrying a sequence of authenticators until one succeeds. - JwtAuthenticator
- Built-in
AuthenticatorvalidatingAuthorization: Bearer <jwt>viaJwtCodec. - JwtClaims
- Standard and extensible JSON Web Token claims payload.
- JwtCodec
- High-performance HS256 JWT signer and verifier with
kidkey-rotation support. - JwtHeader
- JWT JWS header decoded from the first segment of a compact token.
Enums§
- Auth
Error - Errors produced during token decoding, credential verification, or RBAC authorization.
- Auth
Scheme - Authentication mechanism that verified an
crate::AuthPrincipal.
Constants§
- ATTR_
AUTH_ PRINCIPAL - Context attribute key where
crate::AuthHookstores the authenticatedcrate::AuthPrincipal. - DEFAULT_
JWT_ LEEWAY_ SECS - Default JWT clock-skew leeway in seconds.
- DEFAULT_
WWW_ AUTHENTICATE - Default
WWW-Authenticatechallenge header emitted on401 Unauthorized. - JWT_
ALG_ HS256 - Supported JWT algorithm identifier (
HMAC-SHA256). - JWT_
TYP_ JWT - Standard JWT
typheader value.
Traits§
- Authenticator
- Pluggable asynchronous authenticator resolving a Hyperlane
Contextinto anAuthPrincipal.
Functions§
- auth_
now_ secs - Returns the current Unix epoch timestamp in whole seconds.
- base64_
decode - Decodes a standard RFC 4648 base64 string (used by HTTP Basic authentication).
- base64url_
decode - Decodes an unpadded RFC 4648 base64url string.
- base64url_
encode - Encodes
inputusing unpadded RFC 4648 base64url. - constant_
time_ eq - Compares two byte slices in constant time with respect to their contents.
- hmac_
sha256 - Computes the RFC 4231 HMAC-SHA256 tag of
dataunderkeywith zero heap allocations. - sha256
- Computes the FIPS 180-4 SHA-256 digest of
data.
Type Aliases§
- Auth
Future - Boxed
Sendfuture returned by an asyncAuthenticator.