Rotating JWT token service for Swarmauri
Project description
swarmauri_tokens_rotatingjwt
Rotating JWT token service plugin for Swarmauri.
This package provides a token issuer/verifier that automatically rotates its
signing key. It exposes a RotatingJWTTokenService implementing
ITokenService and conforms to RFC 7515, 7517, 7518 and 7519.
Features
- Supports RS256, PS256, ES256, EdDSA and HS256 algorithms.
- Automatic key rotation based on time or token count.
- JWKS publication retaining previous key versions.
Installation
uv add swarmauri_tokens_rotatingjwt
Optional extras are available for specific signing canons:
uv add swarmauri_tokens_rotatingjwt[rsa]
uv add swarmauri_tokens_rotatingjwt[ecdsa]
uv add swarmauri_tokens_rotatingjwt[eddsa]
uv add swarmauri_tokens_rotatingjwt[hmac]
Usage
from swarmauri_tokens_rotatingjwt import RotatingJWTTokenService
from swarmauri_keyprovider_inmemory import InMemoryKeyProvider
from swarmauri_core.crypto.types import JWAAlg
kp = InMemoryKeyProvider()
service = RotatingJWTTokenService(kp, alg=JWAAlg.RS256)
token = await service.mint({"sub": "alice"}, alg=JWAAlg.RS256)
claims = await service.verify(token)
jwks = await service.jwks()
The service handles key rotation based on time or token volume and exposes a JWKS endpoint that includes previous keys so existing tokens remain valid.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_tokens_rotatingjwt-0.3.0.dev48.tar.gz.
File metadata
- Download URL: swarmauri_tokens_rotatingjwt-0.3.0.dev48.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1739b387eb49bb591a1f46856c804ca78be070478872df4bebd89c81239ba86
|
|
| MD5 |
3d9eba119dbc4608e067a1ba6a500ddf
|
|
| BLAKE2b-256 |
15e9c2c621ddc4f73b5dad1001ca4875f5834b3f01ceeea1c3153ff9e4d5b87e
|
File details
Details for the file swarmauri_tokens_rotatingjwt-0.3.0.dev48-py3-none-any.whl.
File metadata
- Download URL: swarmauri_tokens_rotatingjwt-0.3.0.dev48-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dd69499595b6e1dd9b6d9b54bfcf912b7103f8a1652e13421f7f96fb3ec0ee0
|
|
| MD5 |
460dbe0b3a300f27ab364a128c979ef4
|
|
| BLAKE2b-256 |
f3a40f7cd901039813adb2f203c624f808d470f5511881b4f8cd3dadba979584
|