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
- Installation
- Quickstart
- Migrating from armasec covers every behavior difference from upstream 3.x, and what each one requires of you.
- Security covers the JWT verification order, the threat model, and what the attack suite defends.
- Architecture covers the request lifecycle, the caching model and the threading model.
- API Reference
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file armasec_lite-0.1.7.tar.gz.
File metadata
- Download URL: armasec_lite-0.1.7.tar.gz
- Upload date:
- Size: 106.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcece9e48f551dc0c67a065e0d93c5a0574c9fbfe35e02d8c24f9c5aa2f20412
|
|
| MD5 |
15f00b1fc2902b7104e12e9ec7ea3205
|
|
| BLAKE2b-256 |
9112a1d03ab7506689d289630ca4dfd25fb3ae98e6a2d88e259d7f6daed5a758
|
Provenance
The following attestation bundles were made for armasec_lite-0.1.7.tar.gz:
Publisher:
release.yml on vantagecompute/armasec-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
armasec_lite-0.1.7.tar.gz -
Subject digest:
bcece9e48f551dc0c67a065e0d93c5a0574c9fbfe35e02d8c24f9c5aa2f20412 - Sigstore transparency entry: 2772751935
- Sigstore integration time:
-
Permalink:
vantagecompute/armasec-lite@797ba8943cfa5ffbb78efb5a4dd987cabdf7566f -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/vantagecompute
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@797ba8943cfa5ffbb78efb5a4dd987cabdf7566f -
Trigger Event:
push
-
Statement type:
File details
Details for the file armasec_lite-0.1.7-py3-none-any.whl.
File metadata
- Download URL: armasec_lite-0.1.7-py3-none-any.whl
- Upload date:
- Size: 77.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58e9db12ff4f0981baa7b80ccff183eeabb2218a369f018f51a4968da4fc1ffb
|
|
| MD5 |
2781fd7bdda921c0738d7703d8d8879a
|
|
| BLAKE2b-256 |
3994adc61b40e3741e70fbba0e4f2d8419edc5a744c5bd51b65df8074ff60e2a
|
Provenance
The following attestation bundles were made for armasec_lite-0.1.7-py3-none-any.whl:
Publisher:
release.yml on vantagecompute/armasec-lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
armasec_lite-0.1.7-py3-none-any.whl -
Subject digest:
58e9db12ff4f0981baa7b80ccff183eeabb2218a369f018f51a4968da4fc1ffb - Sigstore transparency entry: 2772751971
- Sigstore integration time:
-
Permalink:
vantagecompute/armasec-lite@797ba8943cfa5ffbb78efb5a4dd987cabdf7566f -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/vantagecompute
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@797ba8943cfa5ffbb78efb5a4dd987cabdf7566f -
Trigger Event:
push
-
Statement type: