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.1

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.1
File Size Uploaded
auth_checker-3.0.1.tar.gz 11.8 kB Details

Built distribution (wheel)

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

Total release size: 18.6 kB

Release files / auth_checker-3.0.1.tar.gz

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

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

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

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

3.0.0

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