Skip to main content

UMACS is a unified management and access control service.

Project description

UMACS User Management and Access Control Service

codecov

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/check with 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:

  1. Log in as service (or set a token another way).
  2. Set UMACS_URL + UMACS_TOKEN (or call configure_client(token=...)).
  3. 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


Download files

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

Source Distribution

umacs-0.9.0.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

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

umacs-0.9.0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

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

Hashes for umacs-0.9.0.tar.gz
Algorithm Hash digest
SHA256 246163959a9c70f564d8d9f02a932e8f3cda72dd267bcc94f6985528cbf2170a
MD5 13a95296b1984da05d6ed9945c5410cb
BLAKE2b-256 995605f200124b27d697659adb9a94c49260c5361f8175a37614f6f2d5c83ce8

See more details on using hashes here.

Provenance

The following attestation bundles were made for umacs-0.9.0.tar.gz:

Publisher: build.yaml on csed-ucm/umacs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for umacs-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 344c4e5024a8324853e249e9160ca9c6b65b106c3d0d2b436accc933e3419b5d
MD5 9739bf422eec25e9fbf636c39d6fe30c
BLAKE2b-256 b923a917e8949578aaac67ee6778645aaedd88cd8d082e1e71c0bf221863a074

See more details on using hashes here.

Provenance

The following attestation bundles were made for umacs-0.9.0-py3-none-any.whl:

Publisher: build.yaml on csed-ucm/umacs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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