🔐 py-jwt — JWT Authentication Library
Doc model: This wiki describes the runtime, architectural, and integration behavior of
jwtlib— the pure, framework-agnostic JWT authentication logic powering service auth. For the full API reference and machine-readable surface, see the Library and MCP tabs.
jwtlib provides pure logic components for user registration, login, token
introspection, and authentication verification. It has no web-framework
dependencies: FastAPI, Flask, or plain asyncio apps can use the same
coroutine-based API.
🚀 Key Features
- Pure logic, any framework — no FastAPI/Flask coupling; drop it into any async application.
- Token introspection — verify any JWT and resolve its user without static sessions or a shared session store.
- Request authentication — logic-only
authenticate_requestguard for the callers that need an authorization decision. - Pluggable persistence —
UserRepositoryis injected; ship the provided MongoDB-backed default or implement your own. - Typed end to end — Pydantic request/response models for every operation,
with full
.pyistubs published for consumers.
⚡ Quick Start
See How to Use for registration, session checks, and introspection flows.
📖 Documentation Structure
| Section | Description |
|---|---|
| Overview | Architecture, layers, and public API surface |
| How to Use | Register, login, session lookup, logout, introspection |
| Framework Integration | Wiring jwtlib into FastAPI and resource servers |
| Development | Setup, tests, and docforge build |
The reference implementations of these skills live in the auth-server service.
🔗 Related Resources
- Source Code: Gitea Repository
- Internal PyPI: pip.aetoskia.com/simple/py-jwt
- Reference service: auth-server —
the canonical service built on
jwtlib - CI: Builds and publishes tagged releases, gated on black / ruff / mypy / pytest.
© Aetoskia Internal — py-jwt 0.0.4