iet-auth
core contracts official
Defines the ports for passwords, credential lookup, sessions, CSRF, profiles, and token revocation.
CoreFeaturesIntegrationsStacksTooling
Used byiet-auth-acl-timescaleiet-auth-basiciet-auth-basic-axumiet-auth-basic-timescaleiet-auth-identity-timescaleiet-auth-login-htmx-axumiet-auth-profilesiet-auth-profiles-axum+8 more
iet-authcontractsAuthentication contractsDepends oniet-corecontractiet-configcontract
How to use it
iet-auth defines the authentication ports — Authenticate, TokenIssuer/Invalidate, session and revocation stores, password hashing — plus profile gating helpers such as profile_enabled and NoProfiles. Adapters implement these traits, and transports share the prepared mechanism through the blanket Arc<T> impls.
// examples/htmx-starter/servers/web/tests/framework_auth_rest.rs
use ;
use ;
;
Secret(re-exported fromiet_config) has noDisplayor deref; call.expose()only at the point of use, and never log it.profile_enabledreturnstruewhen the principal has no profile, consults the store when it does, andfalsefor identifiers longer than 1024 bytes.
How it works
Authentication produces a Principal; profile_enabled then gates that identity through a ProfileStore, and only a verified identity is passed to a TokenIssuer that returns a redacted Secret token.
sequenceDiagram participant C as "Caller" participant A as "Authenticate" participant G as "profile_enabled" participant S as "ProfileStore" participant T as "TokenIssuer" C->>A: "authenticate credentials" A-->>C: "Principal" C->>G: "profile_enabled principal" G->>S: "enabled subject and profile" S-->>G: "bool" C->>T: "issue identity" T-->>C: "Secret token"
Core contract
This page is the crate reference. For the framework-wide runtime and trait model, read Architecture.
What it implements
- Defines the traits other crates implement:
Csrf,TokenIssuer,SessionStore,Authenticate,Invalidate,TokenRevocations,CredentialStore,PasswordVerifier,PasswordHasher,ProfileStore.
What's inside
Modules
src/lib.rs
Public API
(root)
- struct
NoProfiles pub fn valid_identifier(value: &str, max: usize) -> bool— Bounded, nonempty identifiers; adapters choose the capability-specific bound.- trait
Csrf— Session-bound or nonce-bound CSRF capability. Providers must not expose the binding, must enforce expiry, and must compare signatures in constant time.
- trait
TokenIssuer
- struct
SessionRecord - trait
SessionStore
- trait
Authenticate
- trait
Invalidate
- trait
TokenRevocations— JWT denylist storage. Retain each digest until at least the supplied expiry. Failed writes must not be reported as successful invalidation.
- struct
PasswordCredentials - struct
PasswordAccount - trait
CredentialStore
- trait
PasswordVerifier
- trait
PasswordHasher
- trait
ProfileStore— Personas are identity-owned; they are not roles and do not imply a tenant.
Impl map
ProfileStore for NoProfilesTokenIssuer for std::sync::Arc<T>Authenticate<C> for std::sync::Arc<T>Invalidate<C> for std::sync::Arc<T>ProfileStore for std::sync::Arc<T>
Depends on
Used by
iet-auth-acl-timescaleiet-auth-basiciet-auth-basic-axumiet-auth-basic-timescaleiet-auth-identity-timescaleiet-auth-login-htmx-axumiet-auth-profilesiet-auth-profiles-axumiet-auth-profiles-timescaleiet-auth-rbac-timescaleiet-auth-revocations-timescaleiet-auth-session-axumiet-auth-session-cacheiet-auth-session-jwtiet-auth-session-opaqueiet-auth-session-timescale
In this repository
examples/htmx-starterexamples/skills-only-appexamples/skills-only-app-task-tracker
Source: crates/core/iet-auth