A comprehensive FastAPI library for Authentication and NIST-style Role-Based Access Control (RBAC) with SQLAlchemy support.
Project description
FastAPIOAuthRBAC
A comprehensive FastAPI library for Authentication and NIST-style Role-Based Access Control (RBAC).
📖 Complete Documentation
The documentation has been significantly improved and split into easy-to-digest resources:
- Documentation Index - Start here for the full overview.
- 🚀 Getting Started - Installation and basic usage.
- ⚙️ Configuration - Environment variables and setup.
- 🛡️ NIST RBAC Model - Learn about roles, hierarchies, and permissions.
- 🖥️ Admin Dashboard - Guide to the visual administration panel.
- 💻 Frontend Integration - Vanilla JS & React guides.
🛠️ Examples
Check out the examples/ directory for practical implementations:
basic_app.py: Standard implementation.multi_tenancy.py: [NEW] Scoping users and roles to tenants.advanced_extension.py: [NEW] Custom User models, Hooks, and Email services.testing_example.py: [NEW] How to test your protected routes.
Quick Start (Minimal)
from fastapi import FastAPI
from fastapi_oauth_rbac import FastAPIOAuthRBAC
app = FastAPI()
# Initialize with default settings or your own Settings object
auth = FastAPIOAuthRBAC(app)
# Explicitly include the routes you want
auth.include_auth_router()
auth.include_dashboard()
📦 Installation Extras
# For PostgreSQL support
pip install "fastapi-oauth-rbac[postgres]"
# For SQLite support (async)
pip install "fastapi-oauth-rbac[sqlite]"
Features
- Asynchronous: Full support for
aiosqlite,asyncpg, etc. - NIST RBAC: Advanced Role-Based Access Control with hierarchy.
- Full Auth Flow: Login, Signup, OAuth (Google), and Global Logout.
- Premium Dashboard: Manage users and roles through a beautiful glassmorphism UI.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_oauth_rbac-0.1.9.tar.gz.
File metadata
- Download URL: fastapi_oauth_rbac-0.1.9.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a50efffd40dc0b71e0e4845b10dd223537f37ef6fa7ea3e2378ac4795cc57b71
|
|
| MD5 |
8a0d87512b3588e1a24df4870075d483
|
|
| BLAKE2b-256 |
df85b9924911039394ae5ce24e5f44297ea2f0fbbd43106c61a7c26d6fe2f0fb
|
File details
Details for the file fastapi_oauth_rbac-0.1.9-py3-none-any.whl.
File metadata
- Download URL: fastapi_oauth_rbac-0.1.9-py3-none-any.whl
- Upload date:
- Size: 41.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0239e6c42700e6b21e36d4d1acfe1c483a4d7b40803452acd432398879d40f12
|
|
| MD5 |
004cb4e6bccdea21c1ae68bdcebd34cc
|
|
| BLAKE2b-256 |
d1c664a0b9fa44447649235ee7f42ebda851cecba3265f62dc8b4e08922a2863
|