Skip to main content

armasec-lite

Injectable FastAPI auth via OIDC, with three dependencies instead of ten.

License Python PyPI Build Status GitHub Issues Pull Requests GitHub Contributors

armasec-lite validates bearer tokens against your identity provider's JWKS, checks scopes and issuer/audience claims, and guards a route with a single Depends(). It is a dependency-minimal reimplementation of armasec 3.x with the same public API, built almost entirely on the standard library. Runtime dependencies are fastapi, cryptography and pydantic.

Install

uv add armasec-lite

The pytest fixtures, including the mock OIDC provider, live behind an extra:

uv add "armasec-lite[test]"

Usage

"""Secure a single route against one OIDC domain."""

import os

from armasec_lite import Armasec
from fastapi import Depends, FastAPI

app = FastAPI()
armasec = Armasec(
    domain=os.environ.get("ARMASEC_DOMAIN"),
    audience=os.environ.get("ARMASEC_AUDIENCE"),
)


@app.get("/stuff", dependencies=[Depends(armasec.lockdown("read:stuff"))])
async def check_access():
    return {"message": "Successfully authenticated!"}

Runnable variants, including multiple domains, match_keys, permission extractors and the plugin system, are in examples/.

Documentation

docs.vantagecompute.ai/developer/armasec-lite

License

MIT. See LICENSE.

Download files

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

Source Distribution

armasec_lite-0.1.4.tar.gz (996.2 kB view details)

Uploaded Source

Built Distribution

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

armasec_lite-0.1.4-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file armasec_lite-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for armasec_lite-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b577e3869f3d5c410e9945a36df5a9ae4fe206f098e384aaa88362ecb8c9ecbf
MD5 e25bb657c9e2c4172ceeed39d514ad84
BLAKE2b-256 1e92d6996bc76d28a38ceb5bb2dc2c18f57a8c4064574b1d07c3d532146c4f94

See more details on using hashes here.

Provenance

The following attestation bundles were made for armasec_lite-0.1.4.tar.gz:

Publisher: release.yml on vantagecompute/armasec-lite

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

File details

Details for the file armasec_lite-0.1.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for armasec_lite-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 219ddbf6f09346a0134999ce31ca381e00cce565231658372573299ba327c128
MD5 fd34ce0a2a2a5bb5fd78d393ed2fd6bf
BLAKE2b-256 93f7b52d93c21414f528a27a006dbdcf975122c419dd3bb353ab28c314244262

See more details on using hashes here.

Provenance

The following attestation bundles were made for armasec_lite-0.1.4-py3-none-any.whl:

Publisher: release.yml on vantagecompute/armasec-lite

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

Release history Release notifications | RSS feed

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

This release

0.1.4 This release

2 files

0.1.3

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