FastAuth v0.6.0
FastAuth 0.6.0 is a complete overhaul: modern dependency stack, one-call setup, production safety mode, and full account lifecycle flows.
Highlights
- One-call integration:
auth.setup(app)mounts login, refresh, registration, logout, roles, and error handling - Zero config:
FastAuth(engine=engine)is enough in development; secrets come from the environment in production - Production mode:
production=Trueenforces a strong secret, secure cookies, and no default admin password - Account flows: password reset and change, email verification, and token revocation (
POST /logout/all) - Ready-made dependencies:
auth.current_user,auth.admin,auth.roles(...),auth.required,auth.verified_user
Fixes
- Works with modern bcrypt (4.x and 5.x): passlib replaced with direct bcrypt
- Removed the shared database session (not thread-safe, and one failed request could break later logins)
- The
disabledflag is enforced on login, token refresh, and protected routes - Duplicate email on registration returns 409 instead of a server error
- Custom user models are respected by role checks and the CLI
- An explicit Authorization header takes precedence over the auth cookie
Project
- Packaging moved to
pyproject.toml; python-jose dropped; Python 3.10+ - 41 tests running in CI on Python 3.10 to 3.14
- Automated PyPI releases via trusted publishing
- Redesigned documentation site plus a new easy-mode tutorial for students
AGENTS.mdso AI coding assistants can integrate FastAuth correctly
Breaking changes
- Python 3.10+ required
- Root-level module shims (
fastauth.py,User.py) removed; import from thefastauthpackage FastAuth.sessionremovedcookie_securedefaults toFalsein development andTruein production mode- The user table gains
email_verifiedandtoken_versioncolumns. For existing databases:
ALTER TABLE user ADD COLUMN email_verified BOOLEAN DEFAULT 0;
ALTER TABLE user ADD COLUMN token_version INTEGER DEFAULT 0;Install: uv add fastauth_iq "fastapi[standard]" · PyPI: https://pypi.org/project/fastauth-iq/0.6.0/