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.0.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.0.0
File Size Uploaded
auth_checker-3.0.0.tar.gz 11.8 kB Details

Built distribution (wheel)

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

Total release size: 18.6 kB

Release files / auth_checker-3.0.0.tar.gz

Download URL auth_checker-3.0.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
298b28c2100ac9a4ec980a252f63184f378e94731ae8d07d05c7cabda5fff11f
BLAKE2b-256 checksum
How to use checksums
ef3cd220150bc0b95be066df90a3fc9cf8810abcdaded0c64b7fadb87878e12f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

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

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

Release history Release notifications | RSS feed

3.0.1

2 release files

This release

3.0.0 This release

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.12

2 release files

2.0.11

2 release files

2.0.10

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.1

2 release files

1.0.0

2 release 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