Project
Changelog
Every change to fastauth, newest first.
0.2.0 (2026-11-26)
New plugins
- fastauth-plugin-organization (feature
organization,fastauth::plugins::organization): organizations, members, invitations by email, the active organization on the session, owner/admin/member roles with custom roles and typed permissions,OrganizationExt, and the axum extractorsActiveMember,OrgMember<A, FromPath<P>>andRequirePermission<A, P, S>. Wire-compatible with Better Auth’sorganizationClient(compat/better-auth/run-organization.sh). (docs/12, #19) - fastauth-plugin-admin (feature
admin,fastauth::plugins::admin): Better Auth’s 15/admin/*routes, statement-based roles and permissions, bans enforced by a sign-in gate, impersonation, case-sensitive user search in SQL,AdminExt, and theRequireRole<A, R>extractor. Wire-compatible withadminClient(compat/better-auth/run-admin.sh). (docs/13, #18) - fastauth-plugin-api-key (feature
api-key,fastauth::plugins::api_key): hashed API keys with expiry, usage limits and refills, per-key rate limits and permissions, server-only verify and cleanup, atomic counters,ApiKeysExt, and sessions fromx-api-key, opt-in withApiKeys::new().sessions(true). Wire-compatible with@better-auth/api-key’sapiKeyClient. (docs/14, #17) - The facade gains the
organization,adminandapi-keyfeatures; withaxumon, they turn on the plugins’ extractors. Theaxum_sqliteexample registers all three, andcompat/better-auth/run.shchecks the API key flow. (#21)
Breaking
- Ids are ULIDs by default.
FastAuth::builder().ids(..)picks the strategy:IdStrategy::Ulid(default),UuidV7,UuidV4, orIdStrategy::custom(|| ..). Custom ids are checked when generated (non-empty, at most 255 bytes); a bad one fails the request with a 500 and a log line. - Postgres id columns are
textfor new installs under the default and custom strategies, anduuidunder the UUID strategies. A database created with 0.1 hasuuidcolumns: keep it working with.ids(IdStrategy::UuidV7). The migrator never changes column types; it warns when the live id columns don’t match the configured strategy. SQLite stores ids astexteither way. ctx.new_id()returnsResult<Id, AuthError>: usectx.new_id()?.fastauth_core::testing::conformance_schemaandhttp_flowtake theIdStrategyto store ids with, andrun_adapter_conformanceruns every case with text ids and with UUID ids.- Sign-in gates still run after a challenge. Finishing a challenged sign-in with
ctx.internal().create_session(..)skipped every other gate, so a banned user who answered a TOTP challenge got a session. Gates now belong to the plugin that registered them, andctx.internal().complete_sign_in(challenger, user, method, remember_me)runs every gate except the challenger’s before creating the session.create_sessionstays the low-level, gate-free primitive. SignInAttempt::methodis aCow<'static, str>, so a completed sign-in keeps its original method;Internal::sign_intakesimpl Into<Cow<'static, str>>.AuthInstancehas a requiredtry_plugin::<P>(), implemented forAuth.fastauth_core::adapter::Filteris#[non_exhaustive]. Adapters need a fallback arm, which should answerDbError::Unsupported.- two-factor: the verify endpoints finish a pending sign-in through the other plugins’
gates. A gate that denies answers its error; a gate that challenges answers its JSON, so
VerifyOutputis an enum (Verified { token, user }orChallenge(json)). A pending sign-in started before the upgrade must start again.
Added
Filter::ContainsandFilter::EndsWith, withCol::containsandCol::ends_withonStringcolumns. LikeStartsWith, they are case-sensitive and match literally:%,_and*are not wildcards. Implemented inMemoryAdapterand fastauth-sqlx (PostgresLIKE .. ESCAPE '\', SQLiteGLOBwith bracket escapes) and covered by the adapter conformance suite.AuthInstance::try_plugin::<P>(), for code generic overAuthInstance(an axum extractor) that can’t name theHasPluginindex.Api::db(): typed queries outside a request, for the same kind of code.IdStorage, withSchema::id_storage(),TableDef::id_storage()andLiveSchema::id_storagefor adapters that store ids per strategy.- Docs: every page rewritten to match
main, new pages for the three plugins, and the agent skill updated; every Rust sample compiles. PluginBuilder::server_endpoint::<E>()declares an endpoint with no HTTP route that hooks can still target. Core’sCreateUser, the organization plugin’sAddMember,CheckPermissionandUserInvitations, and the API key plugin’sVerifyApiKeyandDeleteAllExpiredApiKeysuse it, so hooking them is no longer aBuildError.- Core event
UserDeleted { user_id, email }, emitted by the admin plugin’sremove-user.
Fixed
- Organization: the server API’s
createruns the sameCreateOrganizationendpoint as the route (CreateOrganization::client()/::server()), so hooks on it run for both;CreateOrganizationInputgains a server-onlyuser_id, which a request body can’t set.add_memberruns hooks onAddMember.CreateOrganizationForandNewOrganizationare gone. - Admin:
RequireRole<_, role::Admin>lets in every admin byAdmin::is_admin, the check the endpoints use: any configured admin role, whatever its name, andadmin_user_idswhatever their role. Before, it only knew the role namedadmin. CustomRolemarkers can override the newRole::held_by. - Admin:
set-user-passwordemitsPasswordChanged, like core’s change and reset. - Doc comments:
Api::create_usernamesUSER_ALREADY_EXISTS_USE_ANOTHER_EMAIL,ListUserInvitationspoints atinvitations_for_email, and the facade’s plugin links are no longer ambiguous to rustdoc.
0.1.0 (2026-11-25)
First release.
- fastauth-core:
FastAuth::builder(), the compile-checked plugin list (plugins![..],Has,Requires), the plugin API (endpoints withAccess, typed hooks, sign-in gates, session resolvers, events), sessions with hashed tokens, sliding expiry and an optional cookie cache, HKDF-derived keys with rotation, argon2id, CSRF origin checks, GCRA rate limiting, and the Better Auth-compatible core endpoints: email and password, sessions, email verification, password reset, user updates. - fastauth-axum:
auth.router(),auth.service(),auth.session_layer(), and theSession,Option<Session>andFreshSessionextractors. - fastauth-sqlx: Postgres and SQLite adapter, additive migrations, generated SQL, and
shared transactions with per-call savepoints (
auth.api().in_tx(&tx)). - fastauth-macros:
#[derive(Fields)],#[derive(Model)],#[derive(AuthError)]. - fastauth-oauth: the
Socialplugin with GitHub and Google, PKCE, state bound to the browser, account linking by verified email, profile mapping, per-providerdisable_sign_up. - fastauth-plugin-two-factor: TOTP, email codes, backup codes, trusted devices.
- fastauth-cli:
fastauth secret, plusfastauth::cli::runfor schema, status, generate and migrate from your own binary. - Tested against Better Auth’s TypeScript client 1.7.28.