Skip to content

FastAuth v0.6.0

Choose a tag to compare

@hu55ain3laa hu55ain3laa released this 11 Aug 07:30
· 21 commits to main since this release

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=True enforces 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 disabled flag 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.md so AI coding assistants can integrate FastAuth correctly

Breaking changes

  • Python 3.10+ required
  • Root-level module shims (fastauth.py, User.py) removed; import from the fastauth package
  • FastAuth.session removed
  • cookie_secure defaults to False in development and True in production mode
  • The user table gains email_verified and token_version columns. 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/