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.8.tar.gz (108.6 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.8-py3-none-any.whl (79.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: armasec_lite-0.1.8.tar.gz
  • Upload date:
  • Size: 108.6 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.8.tar.gz
Algorithm Hash digest
SHA256 38bcbbcde17e5b4ac903f1a71ce8718ffd362901d3e00ca9b02c0964400109cc
MD5 65b96fc2400426401ca1ee87bd63e63e
BLAKE2b-256 b2b51c52102f4f7edff55ddebbfc9b854b5a4f1841f70627580c6ad9c8921f9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for armasec_lite-0.1.8.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.8-py3-none-any.whl.

File metadata

  • Download URL: armasec_lite-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 79.9 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1f71cd2982cfce6047256e0b12835aa3d2375228b57faecc54e4d26b2846266b
MD5 1bea6c11d04b8d291fe232525d284ae0
BLAKE2b-256 18810bb426bcd5eded5d650475f1e0e0f68d1677f3ca764519c2d4a299aaa8f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for armasec_lite-0.1.8-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

This release

0.1.8 This release

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

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