Metadata-Version: 2.4
Name: outlabs-auth
Version: 0.1.0a10
Summary: Open-source FastAPI authentication and authorization library with RBAC, ABAC, and Postgres-backed permissions.
Project-URL: Homepage, https://outlabs.io
Project-URL: Documentation, https://github.com/outlabsio/outlabsAuth#readme
Project-URL: Repository, https://github.com/outlabsio/outlabsAuth
Project-URL: Issues, https://github.com/outlabsio/outlabsAuth/issues
Author-email: OUTLABS LLC <contact@outlabs.io>
Maintainer-email: OUTLABS LLC <contact@outlabs.io>
License: MIT License
        
        Copyright (c) 2026 OUTLABS LLC
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: abac,authentication,authorization,fastapi,jwt,permissions,postgresql,rbac,sqlmodel
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: alembic>=1.13.0
Requires-Dist: asyncpg>=0.29.0
Requires-Dist: click>=8.1.0
Requires-Dist: email-validator>=2.0.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: makefun>=1.15.0
Requires-Dist: prometheus-client>=0.19.0
Requires-Dist: pwdlib[argon2,bcrypt]>=0.2.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyjwt[crypto]>=2.8.0
Requires-Dist: python-dateutil>=2.8.0
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: redis>=6.2.0
Requires-Dist: sqlalchemy[asyncio]>=2.0.0
Requires-Dist: sqlmodel>=0.0.22
Requires-Dist: structlog>=23.0.0
Provides-Extra: all
Requires-Dist: aio-pika>=9.0.0; extra == 'all'
Requires-Dist: aiosmtplib>=3.0.0; extra == 'all'
Requires-Dist: black>=23.0.0; extra == 'all'
Requires-Dist: factory-boy>=3.3.0; extra == 'all'
Requires-Dist: faker>=20.0.0; extra == 'all'
Requires-Dist: httpx-oauth>=0.13.0; extra == 'all'
Requires-Dist: httpx>=0.25.0; extra == 'all'
Requires-Dist: mypy>=1.5.0; extra == 'all'
Requires-Dist: prometheus-client>=0.19.0; extra == 'all'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'all'
Requires-Dist: pytest-cov>=5.0.0; extra == 'all'
Requires-Dist: pytest>=7.4.0; extra == 'all'
Requires-Dist: python-telegram-bot>=20.0; extra == 'all'
Requires-Dist: redis>=5.0.0; extra == 'all'
Requires-Dist: ruff>=0.9.0; extra == 'all'
Requires-Dist: sendgrid>=6.10.0; extra == 'all'
Requires-Dist: structlog>=23.0.0; extra == 'all'
Requires-Dist: twilio>=8.0.0; extra == 'all'
Requires-Dist: uvicorn[standard]>=0.24.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: mypy>=1.5.0; extra == 'dev'
Requires-Dist: questionary>=2.0.0; extra == 'dev'
Requires-Dist: ruff>=0.9.0; extra == 'dev'
Requires-Dist: uvicorn[standard]>=0.24.0; extra == 'dev'
Provides-Extra: notifications
Requires-Dist: aio-pika>=9.0.0; extra == 'notifications'
Requires-Dist: aiosmtplib>=3.0.0; extra == 'notifications'
Requires-Dist: httpx>=0.25.0; extra == 'notifications'
Requires-Dist: python-telegram-bot>=20.0; extra == 'notifications'
Requires-Dist: sendgrid>=6.10.0; extra == 'notifications'
Requires-Dist: twilio>=8.0.0; extra == 'notifications'
Provides-Extra: oauth
Requires-Dist: httpx-oauth>=0.13.0; extra == 'oauth'
Provides-Extra: redis
Requires-Dist: redis>=5.0.0; extra == 'redis'
Provides-Extra: stress
Requires-Dist: aiohttp>=3.9.0; extra == 'stress'
Requires-Dist: asyncio-throttle>=1.0.2; extra == 'stress'
Requires-Dist: click>=8.1.0; extra == 'stress'
Requires-Dist: docker>=7.0.0; extra == 'stress'
Requires-Dist: factory-boy>=3.3.0; extra == 'stress'
Requires-Dist: faker>=20.0.0; extra == 'stress'
Requires-Dist: httpx>=0.25.0; extra == 'stress'
Requires-Dist: locust>=2.17.0; extra == 'stress'
Requires-Dist: matplotlib>=3.8.0; extra == 'stress'
Requires-Dist: memory-profiler>=0.61.0; extra == 'stress'
Requires-Dist: pandas>=2.1.0; extra == 'stress'
Requires-Dist: prometheus-client>=0.19.0; extra == 'stress'
Requires-Dist: psutil>=5.9.0; extra == 'stress'
Requires-Dist: py-spy>=0.3.14; extra == 'stress'
Requires-Dist: requests>=2.31.0; extra == 'stress'
Requires-Dist: rich>=13.7.0; extra == 'stress'
Requires-Dist: uvloop>=0.19.0; extra == 'stress'
Provides-Extra: test
Requires-Dist: factory-boy>=3.3.0; extra == 'test'
Requires-Dist: faker>=20.0.0; extra == 'test'
Requires-Dist: httpx>=0.25.0; extra == 'test'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
Requires-Dist: pytest-cov>=5.0.0; extra == 'test'
Requires-Dist: pytest>=7.4.0; extra == 'test'
Description-Content-Type: text/markdown

# OutlabsAuth

Open-source FastAPI authentication and authorization for RBAC, ABAC, API keys, and Postgres-backed permission models.

[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
[![Stage: Alpha](https://img.shields.io/badge/stage-alpha-red.svg)](#status)

> **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

```bash
pip install outlabs-auth
```

You will also need a PostgreSQL database available to the consuming app.

## Quickstart

```python
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/`](/Users/macbookm3/Documents/projects/outlabsAuth/examples)
- Maintainer release guide: [`docs/PRIVATE_RELEASE.md`](/Users/macbookm3/Documents/projects/outlabsAuth/docs/PRIVATE_RELEASE.md)

## License

MIT, copyright 2026 OUTLABS LLC.
