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()

# 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


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.10.tar.gz (28.7 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.10-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastapi_oauth_rbac-0.1.10.tar.gz
Algorithm Hash digest
SHA256 64be8543ebd7dc4b733746d5559e0debaf2cdf40929d0074fc07e258afd1e814
MD5 152dcc6f804052f7093ee2bb5b6c3f69
BLAKE2b-256 eff6a2ec27c586a5afcedd3c05fd313a63e70212d4d6d72ca02a5c34294a4b52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_oauth_rbac-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 2fb0c0f9c4509783bcd1d4b3bf337528ee7c9482d4a992e73ef3573e3cfac9fe
MD5 98d3a60d3623db1f1487c580e8bdaf66
BLAKE2b-256 fdaa0e5fdc3a22b9216057e0d8676daf12bb96b5e66228e5a6cf5cc14cfcbf4c

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