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.6.tar.gz (105.1 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.6-py3-none-any.whl (76.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: armasec_lite-0.1.6.tar.gz
  • Upload date:
  • Size: 105.1 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.6.tar.gz
Algorithm Hash digest
SHA256 028ce30e7b3881170ecf15a60d84cdc3979bb778bcd6fea931086785d48f4a3e
MD5 e7bad795d7be5289a885527766e279ce
BLAKE2b-256 85643e22cd7dff877b9f2b46422a4b4d7468725efa73cf810fb35de3f50b997b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: armasec_lite-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 76.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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c49b3096b5ed180041f6b09e4178f5d9a8b90be02027c501a2a35e9ec7beae0e
MD5 ee95225e232f09b7af1aee683e8f7781
BLAKE2b-256 9d2fc650993eefa61f4415f95744881e4acecda8deaae9690730de74151d1a35

See more details on using hashes here.

Provenance

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

This release

0.1.6 This release

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