{"id":23292,"library":"authx","title":"AuthX","description":"Ready-to-use and customizable authentication and OAuth2 management for FastAPI. Provides JWT, session, rate limiting, and scope management. Current version 1.6.0, requires Python >=3.9, rapid releases.","status":"active","version":"1.6.0","language":"python","source_language":"en","source_url":"https://github.com/yezz123/authx","tags":["authentication","oauth2","jwt","fastapi","security"],"install":[{"cmd":"pip install authx","lang":"bash","label":"Install AuthX"}],"dependencies":[{"reason":"AuthX is designed for FastAPI applications","package":"fastapi","optional":false},{"reason":"Request/response models (v2 only since 1.5.0)","package":"pydantic","optional":false}],"imports":[{"note":"AuthX is exported at package level, not from core submodule","wrong":"from authx.core import AuthX","symbol":"AuthX","correct":"from authx import AuthX"},{"note":"Config class is re-exported at package level","wrong":"from authx.config import AuthXConfig","symbol":"AuthXConfig","correct":"from authx import AuthXConfig"}],"quickstart":{"code":"from fastapi import FastAPI, Depends\nfrom authx import AuthX, AuthXConfig\n\napp = FastAPI()\nconfig = AuthXConfig()\nconfig.JWT_SECRET_KEY = \"secret\"\nconfig.JWT_ACCESS_TOKEN_EXPIRES = 3600\nauth = AuthX(config=config)\n\n@app.get(\"/protected\")\ndef protected(user = Depends(auth.get_current_user)):\n    return {\"user\": user}\n\n@app.post(\"/login\")\ndef login(username: str, password: str):\n    # Validate credentials (pseudo)\n    if username == \"test\" and password == \"pass\":\n        token = auth.create_access_token(uid=\"123\")\n        return {\"access_token\": token, \"token_type\": \"bearer\"}\n    return {\"error\": \"Invalid credentials\"}","lang":"python","description":"Minimal FastAPI app with AuthX JWT authentication"},"warnings":[{"fix":"Update your code to use built-in rate limiting: auth.add_rate_limit(...) or session management: auth.create_session(...)","message":"Version 1.6.0 introduces rate limiting and session management. If you were using custom rate limiting or session handling, review changes.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Upgrade your project to Pydantic v2. If you need Pydantic v1, stay on authx<=1.4.3.","message":"Version 1.5.0 drops support for Pydantic v1. Only Pydantic v2 is supported.","severity":"breaking","affected_versions":">=1.5.0"},{"fix":"Replace decode_token(token, data=...) with decode_token(token, extra=...)","message":"'data' keyword argument in decode_token is deprecated since 1.4.2. Use 'extra' instead.","severity":"deprecated","affected_versions":">=1.4.2"},{"fix":"config.JWT_SECRET_KEY = os.environ.get('AUTHX_SECRET_KEY', 'fallback')","message":"JWT_SECRET_KEY must be set; otherwise AuthX defaults to an insecure key. In production, use a strong secret via environment variable.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from authx import AuthX' (package export). Do not use 'from authx.core import AuthX'.","cause":"AuthX was renamed from AuthXCore in early versions; or using wrong import path.","error":"ImportError: cannot import name 'AuthX' from 'authx'"},{"fix":"Run 'pip install authx' and ensure the environment is active.","cause":"AuthX not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'authx'"},{"fix":"Check version: 'from authx import AuthXConfig'; config = AuthXConfig(); config.JWT_SECRET_KEY = '...'","cause":"Trying to set a config attribute before initializing properly or using an outdated config class.","error":"AttributeError: 'AuthXConfig' object has no attribute 'JWT_SECRET_KEY'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}