Skip to main content

A comprehensive FastAPI library for Authentication and NIST-style Role-Based Access Control (RBAC) with SQLAlchemy support.

Project description

FastAPIOAuthRBAC

PyPI version Downloads Downloads Month

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:


🛠️ 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()
auth = FastAPIOAuthRBAC(app)
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_oauth_rbac-0.1.3.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_oauth_rbac-0.1.3-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_oauth_rbac-0.1.3.tar.gz.

File metadata

  • Download URL: fastapi_oauth_rbac-0.1.3.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for fastapi_oauth_rbac-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cbd2f2c886ef21208b51cba11b801cd1ccc92c7ec2d3fde1760e5ac6f6a92731
MD5 033779799b00eab3a7f9aa24b5528b86
BLAKE2b-256 9800b2a9b3ca2ded6289d597e8e7f1f9a706c4697268d5adc76f1f4fcbbe14c2

See more details on using hashes here.

File details

Details for the file fastapi_oauth_rbac-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_oauth_rbac-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 194c57e1f922c9643268888ea99adff38b122df6dddaeac3c9fb5330e2a30e76
MD5 1928b9552e14545228f628772d20479b
BLAKE2b-256 2da6f76040265801fc1570f2d2e5e059ee6bee58bfcc8756b92bdd5814096f05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page