This release is a pre-release and may not be stable for production use.
Jam
Jam (Jam Auth Module) - A universal auth* framework that provides popular auth mechanisms strictly according to the specification.
- Documentation: jam.makridenko.ru
- Changelog: CHANGELOG.md
Install
pip install jamlib
Quick example
from dataclasses import dataclass
from jam import BaseSubject, Jam
@dataclass
class User(BaseSubject):
id: int
email: str = ""
jam = Jam(config="config.toml", subject=User)
user = User(id=1, email="user@example.com")
token = jam.issue(subject=user, via="jwt")
principal = jam.authenticate(token)
user = principal.subject
allowed: bool = jam.authorize(
principal=principal,
permission="post:create"
)
Why Jam?
Jam is a library that provides the most popular AUTH* mechanisms right out of the box.
Framework integrations
Jam provides ready-to-use integrations for the most popular frameworks:
Each integration offers built-in middleware or plugin support for JWT and session-based authentication.
Why choose Jam?
Jam supports many authentication methods out of the box with minimal dependencies. Here is a comparison with other libraries:
| Features / Library | Jam | Authx | PyJWT | AuthLib | OTP Auth |
|---|---|---|---|---|---|
| JOSE | ✅ | ❌ only JWT | ❌ only JWT | ✅ | ❌ |
| JWT black/white lists | ✅ | ❌ | ❌ | ❌ | ❌ |
| PASETO | ✅ | ❌ | ❌ | ❌ | ❌ |
| Server side sessions | ✅ | ✅ | ❌ | ❌ | ❌ |
| OTP | ✅ | ❌ | ❌ | ❌ | ✅ |
| OAuth2 | ✅ | ✅ | ❌ | ✅ | ❌ |
| SAML 2.0 | ✅ | ❌ | ❌ | ❌ | ❌ |
| Flexible config | ✅ | ❌ | ❌ | ❌ | ❌ |
| Modularity | ✅ | ❌ | ❌ | ❌ | ❌ |
Metadata
Release files for jamlib 4.0.0b6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jamlib-4.0.0b6.tar.gz | 117.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jamlib-4.0.0b6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 283.1 kB
Release files / jamlib-4.0.0b6.tar.gz
| Download URL | jamlib-4.0.0b6.tar.gz |
|---|---|
| Size | 117.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
482e7b092e8646fbd47ccb108b659b998bafed392c156f7691aeff53dc6568f3
|
|
BLAKE2b-256 checksum How to use checksums |
bb6e423ac5564e2cd378c51526d7d71ec850b0da4014979be5f1b7f8902a0623
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.11 {"installer":{"name":"uv","version":"0.12.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / jamlib-4.0.0b6-py3-none-any.whl
| Download URL | jamlib-4.0.0b6-py3-none-any.whl |
|---|---|
| Size | 165.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d625173e60f87143e422cf2b91a9be71d1167d7c851a910577136d8962fd289a
|
|
BLAKE2b-256 checksum How to use checksums |
85fb7c4189d5be1e5ebfca8d49364f7c0ce56114e04bf44dd3d453da8b3ac335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.11 {"installer":{"name":"uv","version":"0.12.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|