A drop-in API-key security package for FastAPI with automatic key management and local SQLite storage.
FastAPI simple security is a lightweight, zero-configuration API-key authentication package for FastAPI applications. It provides essential security features like automatic key generation, local SQLite storage, and key lifecycle management, designed for simplicity and rapid setup in development and single-server deployments.
FastAPI developers building simple APIs that need basic API-key authentication without complex setup or external dependencies, particularly for development environments or small-scale, single-server deployments.
Developers choose this for its out-of-the-box functionality with minimal dependencies—requiring only FastAPI and the Python standard library—and its focus on ease of use, avoiding complex configurations while offering key management and logging features.
Drop-in API-key based security for FastAPI
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically generates a secret administrator key on startup and uses a local SQLite database without any manual configuration, making it ready to use immediately.
Requires only FastAPI and the Python standard library, ensuring lightweight integration and reducing potential dependency conflicts.
Provides built-in endpoints for creating, revoking, renewing API keys, and automatic expiration with a default of 15 days, all accessible through administrator interfaces.
Supports API key validation via both headers and query parameters, allowing for versatile client integration based on project needs.
Explicitly not designed for distributed deployments due to reliance on local SQLite storage, making it unsuitable for scalable or multi-server environments.
If the secret key is not set via environment variables, it's auto-generated and logged, which could expose security risks if logs are not properly secured.
Missing capabilities such as per-API key logging, alternative backend storage options, and role-based permissions, as noted in the 'Needed contributions' section of the README.