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.0rc0
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.0rc0.tar.gz | 117.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jamlib-4.0.0rc0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 283.0 kB
Release files / jamlib-4.0.0rc0.tar.gz
| Download URL | jamlib-4.0.0rc0.tar.gz |
|---|---|
| Size | 117.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e39b7f6667bb1d809debd8894c55faf3f0137a216738f6e1c7d5d9f96fc50cfc
|
|
BLAKE2b-256 checksum How to use checksums |
5cf61067c73a35fdb41a4107336ac550ec4d5d3408d3d573b2888dfccece4a17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","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.0rc0-py3-none-any.whl
| Download URL | jamlib-4.0.0rc0-py3-none-any.whl |
|---|---|
| Size | 165.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c5ad62cb814e0ef6161aa0200400ba6848a1a49f93fd814dbe9015f6872e46f
|
|
BLAKE2b-256 checksum How to use checksums |
ec7975b798d8143753f114a420e1b605f63903184d2ca7f1d8629797aa286dab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","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}
|