Skip to main content

Crate hyperlane_plugin_auth

Crate hyperlane_plugin_auth 

Source
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§

ApiKeyAuthenticator
Built-in Authenticator validating static or rotated API keys from a configured header.
AuthConfig
Configuration policy for AuthPlugin and AuthHook.
AuthHook
Opt-in ServerHook authenticating incoming requests and populating ATTR_AUTH_PRINCIPAL.
AuthPlugin
Process-wide AuthPlugin singleton storing AuthConfig and the active Authenticator.
AuthPrincipal
Verified caller identity attached to a Hyperlane Context by AuthHook.
BasicAuthenticator
Built-in Authenticator validating Authorization: Basic <base64> credentials.
CompositeAuthenticator
Composite Authenticator trying a sequence of authenticators until one succeeds.
JwtAuthenticator
Built-in Authenticator validating Authorization: Bearer <jwt> via JwtCodec.
JwtClaims
Standard and extensible JSON Web Token claims payload.
JwtCodec
High-performance HS256 JWT signer and verifier with kid key-rotation support.
JwtHeader
JWT JWS header decoded from the first segment of a compact token.

Enums§

AuthError
Errors produced during token decoding, credential verification, or RBAC authorization.
AuthScheme
Authentication mechanism that verified an crate::AuthPrincipal.

Constants§

ATTR_AUTH_PRINCIPAL
Context attribute key where crate::AuthHook stores the authenticated crate::AuthPrincipal.
DEFAULT_JWT_LEEWAY_SECS
Default JWT clock-skew leeway in seconds.
DEFAULT_WWW_AUTHENTICATE
Default WWW-Authenticate challenge header emitted on 401 Unauthorized.
JWT_ALG_HS256
Supported JWT algorithm identifier (HMAC-SHA256).
JWT_TYP_JWT
Standard JWT typ header value.

Traits§

Authenticator
Pluggable asynchronous authenticator resolving a Hyperlane Context into an AuthPrincipal.

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 input using 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 data under key with zero heap allocations.
sha256
Computes the FIPS 180-4 SHA-256 digest of data.

Type Aliases§

AuthFuture
Boxed Send future returned by an async Authenticator.