mainframe.json_web_token¶
Classes¶
Refresh the JWKS on a fixed schedule, independent of requested key IDs. |
|
Validate Cloudflare Access JSON Web Token using PyJWT. |
Functions¶
|
Return a shared JWKS client with PyJWT's key-set cache. |
Module Contents¶
- class mainframe.json_web_token.CachedPyJWKClient(uri: str, lifespan: float = 10.0)[source]¶
Bases:
jwt.PyJWKClientRefresh the JWKS on a fixed schedule, independent of requested key IDs.
- get_signing_key(kid: str) jwt.PyJWK[source]¶
Return the signing key matching the given
kid.If no match is found in the current JWK Set, the set is refreshed from the endpoint and the lookup is retried once.
- Parameters:
kid (str) – The key ID to look up.
- Returns:
The matching signing key.
- Return type:
PyJWK
- Raises:
PyJWKClientError – If no matching key is found after refreshing.
- mainframe.json_web_token.get_jwks_client(jwks_uri: str) jwt.PyJWKClient[source]¶
Return a shared JWKS client with PyJWT’s key-set cache.
- class mainframe.json_web_token.AuthenticationData[source]¶
-
- issued_at: datetime.datetime[source]¶
- expires_at: datetime.datetime[source]¶