Expand description
Factor implementations for axess: password (Argon2id), TOTP (RFC 6238), HOTP (RFC 4226).
All comparisons against secret material use subtle::ConstantTimeEq;
all in-memory secrets are wrapped in zeroize::Zeroizing so the buffer
is wiped on drop. Verification functions clamp digit length and TOTP
drift windows to defensive bounds.
§Module layout
password: Argon2id hashing/verification re-exports frompassword_auth(passwordfeature).hotp: HOTP per RFC 4226 with SHA-1 / SHA-256 / SHA-512 variants (hotpfeature).totp: TOTP per RFC 6238, secret generation, andotpauth://URI builder (totpfeature).
Each module is feature-gated; lib.rs re-exports everything at the
crate root so downstream code can import via either path.
Re-exports§
pub use password::PasswordConfig;pub use password::PasswordRules;pub use hotp::HOTP_LENGTH;pub use hotp::HotpAlgorithm;pub use hotp::HotpConfig;pub use hotp::verify_hotp;pub use totp::TOTP_LENGTH;pub use totp::TOTP_PERIOD;pub use totp::TotpConfig;pub use totp::TotpVerifyParams;pub use totp::build_totp_uri;pub use totp::generate_totp_secret;pub use totp::verify_totp;pub use email_otp::EmailOtpConfig;pub use fido2::Fido2Config;pub use fido2::DefaultFido2Provider;pub use fido2::Fido2Credential;pub use fido2::Fido2Options;pub use fido2::Fido2Provider;pub use fido2::MockFido2Provider;pub use ldap::LdapBindResult;pub use ldap::LdapError;pub use ldap::LdapGroupSearch;pub use ldap::LdapProvider;pub use ldap::LdapProviderConfig;pub use ldap::MockLdapProvider;pub use mtls::MtlsError;pub use mtls::MtlsResolver;pub use mtls::PeerCertChain;pub use mtls::SpiffeIdComponents;pub use mtls::peek_spiffe;pub use oidc::Discovery;pub use oidc::DiscoveryDocument;pub use oidc::JwksCache;pub use oidc::MIN_JWKS_REFRESH_INTERVAL;pub use oidc::OidcError;pub use bearer::BearerConfig;pub use bearer::BearerError;pub use bearer::BearerIssuerConfig;pub use bearer::BearerTokenLayer;pub use bearer::BearerTokenService;pub use bearer::JwtVerificationError;pub use bearer::WorkloadIdentity;pub use bearer::validate_bearer_token;pub use outbound_oauth_client::ClientAuthMethod;pub use outbound_oauth_client::OAuthClientError;pub use outbound_oauth_client::OutboundOAuthClient;pub use otp_algorithm::OtpAlgorithm;pub use secret::ZeroizedString;
Modules§
- bearer
- Bearer JWT workload-auth middleware. Verifies inbound
Authorization: Bearer <jwt>headers against configured issuers and JWKS, inserts aWorkloadIdentityinto axum request extensions (bearerfeature). Bearer JWT workload authentication middleware. - email_
otp - Server-issued
EmailOtpConfig: the typed challenge state for the out-of-band email factor (email_otpfeature). Email OTP factor configuration: server-issued one-time codes delivered out-of-band by email. - federation
- Workload-identity federation. The generic
federation::workload::WorkloadResolververifies any JWT-bearer workload token (GitHub Actions OIDC, Kubernetes SA, GitLab CI OIDC, Okta, Azure AD, Auth0, axessLocalIdP, …) via a caller-supplied claim parser + mapping closure. Gated on thejwtfeature. Workload-identity federation. - fido2
- FIDO2/WebAuthn factor data:
Fido2Config+Fido2Credential+Fido2Options+ re-exports ofwebauthn-rsprimitives (fido2feature). FIDO2/WebAuthn factor data types: config, credential metadata, options, and re-exports of thewebauthn-rsprimitives the orchestrator persists alongside them. - hotp
- HOTP: HMAC-Based One-Time Passwords (RFC 4226).
- jwt
- JWT validation +
JwtVerifierbuilder + SPIFFE JWT-SVID resolver (jwt/jwt-svidfeatures). Adopters performing JWT verification (workload identity, federated OIDC checks, custom logout flows) share the same hardened parse-and-verify paths internally used by OAuth + back-channel logout. Shared JWT primitives for signature verification and claim validation. - ldap
- LDAP simple-bind verifier:
LdapProvidertrait +LdapProviderConfigproduction impl (ldap3-backed) +MockLdapProvider(ldapfeature). HealthCheck integration lives in axess-core as an extension impl. LDAP bind authentication: verify credentials against Active Directory or any LDAP-compatible directory. - mtls
- mTLS SPIFFE X509-SVID resolver. Extracts a
Principal::Workloadfrom the leaf client certificate in a rustls peer-cert chain (mtlsfeature). SPIFFE X509-SVID resolver over rustls peer-cert chain. - oauth
- OAuth 2.0 / OIDC ceremony surface:
OAuthProvidertrait,DefaultOAuthProvider(openidconnect-backed), builder, device-flow, FAPI 2.0 DPoP (oauth/fapifeatures). OAuth 2.0 / OpenID Connect relying party support. - oidc
- OIDC discovery + JWKS retrieval / rotation primitives (
oidcfeature). Shared between the full OAuth ceremony surface and adopters that verify JWTs without taking it. OIDC discovery and JWKS retrieval primitives. - otp_
algorithm OtpAlgorithm: the storage-shape HMAC algorithm tag shared byTotpConfigandHotpConfig. Gated ontotpORhotpbecause it has no consumer outside the two OTP configs. HMAC algorithm choice shared byTotpConfigandHotpConfig.- outbound_
oauth_ client - Outbound OAuth client:
client_credentialsgrant with optionalprivate_key_jwtclient assertion (RFC 7523) (outbound-oauthfeature). Outbound OAuth client. - password
- Password factor: Argon2id hashing/verification plus the typed
PasswordConfig/PasswordRulesdata the orchestrator persists per user. - pkce
- PKCE (RFC 7636)
code_verifierpredicate. Always-on (no feature gate) because it’s a pure-spec character-class check with no protocol deps. PKCE utilities exposed for application-side validation. - secret
ZeroizedString: secret-string primitive shared across factor configs and other credential-bearing types. Always on (no feature gate) because the orchestrator’s OAuth token storage and delegated-credential storage hold it without thepassword/totp/hotpfeatures. Secret-string primitive shared across factor configs and other credential-bearing types in the axess workspace.- social
- Plain-OAuth-2.0 user login (“social login”) for IdPs that don’t
support OIDC (GitHub user login, Twitter/X, Discord, Reddit,
Spotify, …). Off by default. Weaker security model than the
OIDC path under
oauth: claims come from a TLS-trusted userinfo endpoint, not from a signed assertion. See module docs for the full delta and when to reach for this. Plain-OAuth-2.0 user login (a.k.a. “social login”). - totp
- TOTP: Time-Based One-Time Passwords (RFC 6238).
Structs§
- Authentication
Result - Information about the authentication that occurred.
- TOTP
- TOTP holds informations as to how to generate an auth code and validate it. Its secret field is sensitive data, treat it accordingly
Enums§
- Authenticator
Attachment - The authenticator attachment hint. This is NOT enforced, and is only used to help a user select a relevant authenticator type.
- Totp
Algorithm - Algorithm enum holds the three standards algorithms for TOTP as per the reference implementation
Functions§
- generate_
password_ hash - Generate a password hash for the given password.
- verify_
password - Verify the provided password against the provided password hash.
Type Aliases§
- CredentialID
- The ID of this Credential