Welcome to the comprehensive documentation for FastAPIOAuthRBAC. This library provides a robust, asynchronous implementation of NIST-style Role-Based Access Control (RBAC) and Authentication for FastAPI applications.
| Resource | Description |
|---|---|
| 🚀 Getting Started | Installation and your first "Hello World" with RBAC. |
| ⚙️ Configuration | Environment variables, Database, and OAuth providers. |
| 🛡️ NIST RBAC Model | Deep dive into roles, hierarchies, and permissions. |
| 🖥️ Admin Dashboard | How to manage users and roles visually. |
| 📖 API Reference | Detailed documentation of classes, hooks, and methods. |
| 🏗️ Architecture | Internal design, database schema, and security flow. |
| 🧪 Testing | How to test your application with RBAC helpers. |
| 🏢 Multi-tenancy | Scoping users and roles to tenants. |
| 💻 Frontend Integration | Guides for Vanilla JS and React integration. |
FastAPIOAuthRBAC is designed to be plug-and-play. The library handles database initialization, standard role creation (Admin, User, Viewer), and initial superuser provisioning automatically via the FastAPI lifespan.
from fastapi import FastAPI
from fastapi_oauth_rbac import FastAPIOAuthRBAC
app = FastAPI()
# Initialize (environment variables prefixed with FORBAC_ or explicit settings)
auth = FastAPIOAuthRBAC(app)
auth.include_auth_router()
auth.include_dashboard()