Skip to main content

Auth Checker

Release Status

A library for authorizing users based on their assigned roles, parsed from their JWT payload.

  • Free software: MIT

Usage

Authorize a read operation

from auth_checker import AuthChecker
from fastapi import APIRouter, Depends

# authorize a user with "personnel:read" permissions to look up personnel
@router.get("", tags=["Personnel"], dependencies=[Depends(AuthChecker("personnel:read"))])

Authorize an update operation

from auth_checker import AuthChecker
from fastapi import APIRouter, Depends

# authorize a user with "personnel:write" permissions to disable personnel
@router.post("/disable", tags=["Personnel"], dependencies=[Depends(AuthChecker("personnel:write"))])

Model the JWT payload

TokenPayload models the claims of a decoded JWT: email, roles, inherited_roles, and permissions.

from auth_checker import TokenPayload

payload = TokenPayload(**decoded_jwt)

Metadata

Release files for auth-checker 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auth-checker 3.1.0
File Size Uploaded Provenance Actions
auth_checker-3.1.0.tar.gz 11.9 kB Without provenance Details for auth_checker-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for auth-checker 3.1.0
File Interpreter ABI Platform Actions
auth_checker-3.1.0-py3-none-any.whl Python 3 none any Details for auth_checker-3.1.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / auth_checker-3.1.0.tar.gz

Download URL auth_checker-3.1.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8454a5c2869c3cd243c2e0ffbf041f1a4402bcdd305de9c09d9da21ae97ea516
BLAKE2b-256 checksum
How to use checksums
1f5c486c9347440d15cd98969078138c8a8ed61301d29edd918762e488f00afc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / auth_checker-3.1.0-py3-none-any.whl

Download URL auth_checker-3.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd8422ed0bf435cbaf4e295803340ecbd4bc26bc98d0a588eaf119c5a08a5b14
BLAKE2b-256 checksum
How to use checksums
370a70405130f76b921737623a45b9013294cdf745afbb01732fc335518f7b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Security for auth-checker 3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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