UMACS is a unified management and access control service.
Project description
UMACS User Management and Access Control Service
UMACS (User Management and Access Control Service) is a lightweight, reusable Authorization service.
Features
- Policy Engine based on Casbin for flexible access control, supporting RBAC and ABAC.
- Logging using SQL tables for efficient storage and auditing of decision logs.
- JWKS discovery + caching for validating tokens from configured IdPs and rejecting invalid tokens.
- API for managing users, roles, and permissions.
- Python SDK (
umacs.client) for consumer apps to call/enforce/checkwith a bearer token.
Core Dependencies
The service is built using:
- FastAPI + Uvicorn
- Authlib (OIDC JWT verification)
- Casbin (RBAC + optional ABAC)
- SQLModel + AsyncSQLAlchemy (Policies, Users, Resources, Decision Logs)
- Alembic (Database Migrations)
Quickstart
Prerequisites
Environment
Copy .env.example to .env and set at least:
| Variable | Purpose | Default |
|---|---|---|
SECRET_KEY |
HS256 signing for local login JWTs | supersecret |
DATABASE_URL |
Async SQLAlchemy URL | sqlite+aiosqlite:///./test.db |
Install, migrate, bootstrap, run
uv sync
uv run alembic upgrade head
uv run python scripts/bootstrap_local.py
uv run fastapi dev
# or: uv run uvicorn app.app:app --reload
Bootstrap seeds Casbin path policies (login/docs public, admin full access) and users:
| User | Password | Role |
|---|---|---|
admin |
admin |
admin |
demo |
demo |
user |
service |
service |
service (machine credential for POST /enforce/check) |
Without bootstrap, an empty Casbin policy set will 403 login and other routes.
GET /health stays public and does not require bootstrap.
Docker
Build a multi-stage runtime image and run with the same env vars as .env.example:
docker build -t umacs:local .
docker run --rm -p 8000:8000 \
-e SECRET_KEY=change-me \
-e DATABASE_URL=sqlite+aiosqlite:///./umacs.db \
umacs:local
# probe: curl http://localhost:8000/health
For gated API use inside the container, still run migrations/bootstrap (or mount a pre-seeded DB). Health checks do not require bootstrap.
Consumer apps (SDK)
See examples/consumer_fastapi.py for a T4-shaped FastAPI snippet:
- Log in as
service(or set a token another way). - Set
UMACS_URL+UMACS_TOKEN(or callconfigure_client(token=...)). - Call
AsyncUMACS.check/ protect routes with@require_permission.
Gateway auth uses the service bearer token; the enforce body sub is the end user whose permission you are checking.
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 umacs-0.9.0.tar.gz.
File metadata
- Download URL: umacs-0.9.0.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
246163959a9c70f564d8d9f02a932e8f3cda72dd267bcc94f6985528cbf2170a
|
|
| MD5 |
13a95296b1984da05d6ed9945c5410cb
|
|
| BLAKE2b-256 |
995605f200124b27d697659adb9a94c49260c5361f8175a37614f6f2d5c83ce8
|
Provenance
The following attestation bundles were made for umacs-0.9.0.tar.gz:
Publisher:
build.yaml on csed-ucm/umacs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
umacs-0.9.0.tar.gz -
Subject digest:
246163959a9c70f564d8d9f02a932e8f3cda72dd267bcc94f6985528cbf2170a - Sigstore transparency entry: 2223283547
- Sigstore integration time:
-
Permalink:
csed-ucm/umacs@12c3ab6414c19870f695b47539ce683952d71578 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/csed-ucm
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@12c3ab6414c19870f695b47539ce683952d71578 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file umacs-0.9.0-py3-none-any.whl.
File metadata
- Download URL: umacs-0.9.0-py3-none-any.whl
- Upload date:
- Size: 37.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
344c4e5024a8324853e249e9160ca9c6b65b106c3d0d2b436accc933e3419b5d
|
|
| MD5 |
9739bf422eec25e9fbf636c39d6fe30c
|
|
| BLAKE2b-256 |
b923a917e8949578aaac67ee6778645aaedd88cd8d082e1e71c0bf221863a074
|
Provenance
The following attestation bundles were made for umacs-0.9.0-py3-none-any.whl:
Publisher:
build.yaml on csed-ucm/umacs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
umacs-0.9.0-py3-none-any.whl -
Subject digest:
344c4e5024a8324853e249e9160ca9c6b65b106c3d0d2b436accc933e3419b5d - Sigstore transparency entry: 2223283969
- Sigstore integration time:
-
Permalink:
csed-ucm/umacs@12c3ab6414c19870f695b47539ce683952d71578 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/csed-ucm
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@12c3ab6414c19870f695b47539ce683952d71578 -
Trigger Event:
pull_request
-
Statement type: