Open-source FastAPI authentication and authorization library with RBAC, ABAC, and Postgres-backed permissions.
Project description
OutlabsAuth
Open-source FastAPI authentication and authorization for RBAC, ABAC, API keys, and Postgres-backed permission models.
Alpha release - Public PyPI packaging is supported, but the API surface is still settling before 1.0.
Status
Current Library Version: 0.1.0a10
Release Stage: Alpha
What It Does
OutlabsAuth is a library-first auth system for FastAPI applications that want to keep authentication and authorization inside the app instead of outsourcing it to a separate service.
- SimpleRBAC and EnterpriseRBAC presets
- JWT auth, refresh tokens, API keys, service tokens, and OAuth hooks
- Postgres-backed users, roles, permissions, entities, and audit history
- FastAPI router factories, middleware, and CLI migrations
Install
pip install outlabs-auth
You will also need a PostgreSQL database available to the consuming app.
Quickstart
from contextlib import asynccontextmanager
from fastapi import FastAPI
from outlabs_auth import SimpleRBAC, register_exception_handlers
from outlabs_auth.routers import get_auth_router
auth = SimpleRBAC(
database_url="postgresql+asyncpg://postgres:postgres@localhost:5432/app",
secret_key="change-me",
auto_migrate=True,
)
@asynccontextmanager
async def lifespan(app: FastAPI):
await auth.initialize()
yield
await auth.shutdown()
app = FastAPI(lifespan=lifespan)
register_exception_handlers(app)
app.include_router(get_auth_router(auth, prefix="/auth"))
More
The repository includes deeper examples, packaged CLI flows, and design notes:
- GitHub: https://github.com/outlabsio/outlabsAuth
- Examples:
examples/ - Maintainer release guide:
docs/PRIVATE_RELEASE.md
License
MIT, copyright 2026 OUTLABS LLC.
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 outlabs_auth-0.1.0a10.tar.gz.
File metadata
- Download URL: outlabs_auth-0.1.0a10.tar.gz
- Upload date:
- Size: 254.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cd67f5a806c86c913399fd351b7b4cbb54df2eb4e64050e6ba49b8c5df29d38
|
|
| MD5 |
3864489cc75efcd22b341300a114fb81
|
|
| BLAKE2b-256 |
d1f3e62aae0dea627bf126fe374abd3ed07aaf4d7dab8f419dc3f91b8aae2299
|
Provenance
The following attestation bundles were made for outlabs_auth-0.1.0a10.tar.gz:
Publisher:
publish-pypi.yml on outlabsio/outlabsAuth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
outlabs_auth-0.1.0a10.tar.gz -
Subject digest:
1cd67f5a806c86c913399fd351b7b4cbb54df2eb4e64050e6ba49b8c5df29d38 - Sigstore transparency entry: 1254412370
- Sigstore integration time:
-
Permalink:
outlabsio/outlabsAuth@af22870fea0b6c65d4733b9a5a99c9e5cdcbbf89 -
Branch / Tag:
refs/tags/v0.1.0a10 - Owner: https://github.com/outlabsio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@af22870fea0b6c65d4733b9a5a99c9e5cdcbbf89 -
Trigger Event:
push
-
Statement type:
File details
Details for the file outlabs_auth-0.1.0a10-py3-none-any.whl.
File metadata
- Download URL: outlabs_auth-0.1.0a10-py3-none-any.whl
- Upload date:
- Size: 352.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1daaa6716993ac2c3e31084c84630882c2c123ece67e96a06d6901e75e8e0b88
|
|
| MD5 |
3d4407aa3df39332b6ee2158e10477b7
|
|
| BLAKE2b-256 |
22ca8ac4cf6336f6c4a7e3b799867355c01186764631dbbada0ab03ec5363cd4
|
Provenance
The following attestation bundles were made for outlabs_auth-0.1.0a10-py3-none-any.whl:
Publisher:
publish-pypi.yml on outlabsio/outlabsAuth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
outlabs_auth-0.1.0a10-py3-none-any.whl -
Subject digest:
1daaa6716993ac2c3e31084c84630882c2c123ece67e96a06d6901e75e8e0b88 - Sigstore transparency entry: 1254412487
- Sigstore integration time:
-
Permalink:
outlabsio/outlabsAuth@af22870fea0b6c65d4733b9a5a99c9e5cdcbbf89 -
Branch / Tag:
refs/tags/v0.1.0a10 - Owner: https://github.com/outlabsio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@af22870fea0b6c65d4733b9a5a99c9e5cdcbbf89 -
Trigger Event:
push
-
Statement type: