Skip to main content

AuthMate

AuthMate is a provider-neutral authorization boundary for Python services. Version 0.1.0 is a stateless contract preview: it validates shared values, coordinates principal and authorization providers, and supplies a small FastAPI adapter. It does not authenticate requests, persist data, implement RBAC, manage credentials, or provide a production-readiness guarantee.

Independent by default, composable by contract.

Status

The phase 0.1 runtime is implemented under src/authmate. Read the quickstart and planning index for the public contract and release boundary.

Supported runtime

Python 3.11 through 3.14. Install this checkout with uv sync --group dev. AuthMate is distributed under the MIT License.

Quick start

Providers are host-owned and implement the protocols in authmate.protocols. The service calls the principal provider first, then the authorization provider only for an enabled, non-expired principal.

from uuid import uuid4
from authmate import (
    AccessContext,
    AuthMate,
    AuthorizationDecision,
    PrincipalKind,
    PrincipalRecord,
    PrincipalRef,
)

actor = PrincipalRef(id=uuid4(), kind=PrincipalKind.USER)


class Principals:
    async def get_principal(self, ref):
        return PrincipalRecord(ref=ref, display_name="Ada", enabled=True)

    async def aclose(self):
        pass


class Policy:
    async def authorize(self, *, principal, action, resource):
        return AuthorizationDecision(
            allowed=True, reason="allowed", action=action, resource=resource
        )

    async def aclose(self):
        pass


async def check_request():
    service = AuthMate(principal_provider=Principals(), authorization_provider=Policy())
    try:
        return await service.require(context=AccessContext(actor=actor), action="report.read")
    finally:
        await service.aclose()

See the phase 0.1 quickstart for FastAPI integration, provider contracts, lifecycle behavior, and deliberate non-goals.

Development

uv sync --frozen --group dev
uv run ruff format --check .
uv run ruff check .
uv run mypy --strict src/authmate tests
uv run pytest --cov=authmate --cov-branch --cov-fail-under=95
uv build
uv run twine check dist/*

Planned MVP

  • Users, operator provisioning, opaque SQL-backed browser sessions, and revocation.
  • Service accounts, revocable API tokens, and generic delegated identity.
  • Exact RBAC scopes, FastAPI dependencies, and Python service APIs.
  • Credential metadata, exact secret-use grants, and approved environment references.
  • Durable SQL audit, rate limiting, CSRF protection, and explicit recovery procedures.
  • Typed public contracts, controlled model/provider extensions, and reviewed migrations.

PostgreSQL is the production reference; SQLite supports local development. No Redis, broker, external identity service, or external secret manager is required. Encrypted SQL secret storage, federation, tenancy, and richer extensions have later release gates.

Architecture principles

  • AuthMate owns its security semantics and public contracts; consumers adapt to them.
  • Mandatory service checks remain authoritative with custom providers.
  • Pydantic public contracts are separate from SQLModel/SQLAlchemy persistence.
  • FastAPI composition uses explicit DI, lifespan, security, and OpenAPI integration.
  • Core requires SQL-backed state, not process-local caches or additional services.

Hedron, ShuETL, and other applications may build optional adapters against AuthMate. Core contains no consumer workflow records, callbacks, domain imports, or release dependencies. Consumer-owned compatibility tests establish supported combinations. See Consumer Contracts and MVP gates.

Download files

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

Source Distribution

authmate-0.1.0.tar.gz (142.3 kB view details)

Uploaded Source

Built Distribution

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

authmate-0.1.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file authmate-0.1.0.tar.gz.

File metadata

  • Download URL: authmate-0.1.0.tar.gz
  • Upload date:
  • Size: 142.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for authmate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aef81892483343fa2d47943433c28f59cac03bbf37b051a7d21944f0b09b4149
MD5 8bc3838691d344dd7ec78b3182e33390
BLAKE2b-256 cc932d02cc85b58da47d0f6f00d1b48ecb08a570d7678ff9e7ea5d3f9cf33fd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for authmate-0.1.0.tar.gz:

Publisher: release.yml on eddiethedean/authmate

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

File details

Details for the file authmate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: authmate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for authmate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5f92b49f9cbeb563ce0119d854dda01a71ceba229c30a9c172a482fecdfefbc
MD5 9cbc8bff43fb6f63f38c7200043c12ee
BLAKE2b-256 81b46bc44e6466ba8c404a7d0d933fc646ee355e1e86aaa0cd57842c290e192d

See more details on using hashes here.

Provenance

The following attestation bundles were made for authmate-0.1.0-py3-none-any.whl:

Publisher: release.yml on eddiethedean/authmate

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page