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.

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.8.0.tar.gz (26.6 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.8.0-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

Details for the file umacs-0.8.0.tar.gz.

File metadata

  • Download URL: umacs-0.8.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for umacs-0.8.0.tar.gz
Algorithm Hash digest
SHA256 824c5bf8ac2bf990eedef177e68722fee40c6646a5303c153960e8993614ad2a
MD5 6c6878a506c139fae9e0a04dfec255e3
BLAKE2b-256 0753ebb64ece8298eff1df1dff7da82eb79218bd4acef118528e91741fe2ff20

See more details on using hashes here.

Provenance

The following attestation bundles were made for umacs-0.8.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.8.0-py3-none-any.whl.

File metadata

  • Download URL: umacs-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 37.1 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.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f85ca554a779a910b3168b44bf2a727d0b1ea086bd718bfc923be3ef2e184853
MD5 fc56fad8aac6d795d93d72c35d401738
BLAKE2b-256 92004576e3b44adbdacc9867c5689d9f3f5a5777b0429bb087d3880a681a747b

See more details on using hashes here.

Provenance

The following attestation bundles were made for umacs-0.8.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