Skip to main content

Rotating JWT token service for Swarmauri

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tokens_rotatingjwt


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_tokens_rotatingjwt-0.3.0.dev46.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_tokens_rotatingjwt-0.3.0.dev46.tar.gz.

File metadata

  • Download URL: swarmauri_tokens_rotatingjwt-0.3.0.dev46.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

Hashes for swarmauri_tokens_rotatingjwt-0.3.0.dev46.tar.gz
Algorithm Hash digest
SHA256 4c89b3bc2b0a6f20c060ce39b68ea251ef5e1bb7d85991597287c2ebebf7560d
MD5 020d73d4edacc3c6f9eb072b0bd72dbc
BLAKE2b-256 28978805e2626168f5ee3b0389666e0f118b2eaf944733cf826c281995e3c5e7

See more details on using hashes here.

File details

Details for the file swarmauri_tokens_rotatingjwt-0.3.0.dev46-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tokens_rotatingjwt-0.3.0.dev46-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

Hashes for swarmauri_tokens_rotatingjwt-0.3.0.dev46-py3-none-any.whl
Algorithm Hash digest
SHA256 f43092b2b872d55e5f64f2eb141e7a0860dc4491bcc809e3696823dd4d2b04fe
MD5 95b5c2c87adbc7005b5f2c86635c08bb
BLAKE2b-256 3fcb6fcae6837a4d0ee3b9a85c8673fcca71409174182ad998855a91cb9b6abd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page