Skip to main content

Remote JWKS-backed key provider for verification-only use

Project description

Swamauri Logo

Swarmauri Remote JWKS Key Provider

Key provider backed by a remote JWKS endpoint with local key management.

Installation

pip install swarmauri_keyprovider_remote_jwks

Usage

The provider fetches verification keys from a remote JWKS URL or through an OpenID Connect (OIDC) issuer. It also embeds an in-memory key provider to create and manage local keys. The example below fetches a JWK from a JWKS endpoint and prints its public fields:

import asyncio
from swarmauri_keyprovider_remote_jwks import RemoteJwksKeyProvider


async def main() -> None:
    provider = RemoteJwksKeyProvider(
        jwks_url="https://example.com/.well-known/jwks.json"
    )

    # Optional: pre-fetch the JWKS; otherwise the first key lookup triggers it
    provider.refresh(force=True)

    jwk = await provider.get_public_jwk("test", version=1)
    print(jwk)


asyncio.run(main())

You can also construct the provider from an OIDC issuer. The provider resolves the issuer's discovery document to find the JWKS URL:

RemoteJwksKeyProvider(issuer="https://issuer.example.com")

Locally created keys are available via the standard key provider APIs and are
included alongside remote keys when calling `jwks()`.

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_keyprovider_remote_jwks-0.2.0.dev2.tar.gz (10.0 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_keyprovider_remote_jwks-0.2.0.dev2.tar.gz.

File metadata

File hashes

Hashes for swarmauri_keyprovider_remote_jwks-0.2.0.dev2.tar.gz
Algorithm Hash digest
SHA256 70cceb52ac7742f3c619c499e3ac28d06c08553358766f222539303c8d0884e0
MD5 643eb7a78f463bf5116baf713c1238d5
BLAKE2b-256 3856123f170671a976009f068d1395113b6431b8fe102b610ba01d2c61d1c607

See more details on using hashes here.

File details

Details for the file swarmauri_keyprovider_remote_jwks-0.2.0.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for swarmauri_keyprovider_remote_jwks-0.2.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 d6783a740dfa8f01873abf711a307dded2d9d8794e85669df64ab7b1d9f3076a
MD5 a6d1b7ffe5e32d576552e22bad419694
BLAKE2b-256 cd36a7b11830e4a9e286613782734479e4f3c3fdd46bd7b9cda3505500907677

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