auth0-python
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: auth0-python | ||
| Version: 4.1.1 | ||
| Version: 4.2.0 | ||
| Summary: Auth0 Python SDK | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/auth0/auth0-python |
@@ -1,2 +0,2 @@ | ||
| __version__ = "4.1.1" | ||
| __version__ = "4.2.0" | ||
@@ -3,0 +3,0 @@ from auth0.exceptions import Auth0Error, RateLimitError, TokenValidationError |
@@ -129,18 +129,2 @@ """Token Verifier module""" | ||
| class AsymmetricSignatureVerifier(SignatureVerifier): | ||
| """Verifier for RSA signatures, which rely on public key certificates. | ||
| Args: | ||
| jwks_url (str): The url where the JWK set is located. | ||
| algorithm (str, optional): The expected signing algorithm. Defaults to "RS256". | ||
| """ | ||
| def __init__(self, jwks_url, algorithm="RS256"): | ||
| super().__init__(algorithm) | ||
| self._fetcher = JwksFetcher(jwks_url) | ||
| def _fetch_key(self, key_id=None): | ||
| return self._fetcher.get_key(key_id) | ||
| class JwksFetcher: | ||
@@ -243,2 +227,19 @@ """Class that fetches and holds a JSON web key set. | ||
| class AsymmetricSignatureVerifier(SignatureVerifier): | ||
| """Verifier for RSA signatures, which rely on public key certificates. | ||
| Args: | ||
| jwks_url (str): The url where the JWK set is located. | ||
| algorithm (str, optional): The expected signing algorithm. Defaults to "RS256". | ||
| cache_ttl (int, optional): The lifetime of the JWK set cache in seconds. Defaults to 600 seconds. | ||
| """ | ||
| def __init__(self, jwks_url, algorithm="RS256", cache_ttl=JwksFetcher.CACHE_TTL): | ||
| super().__init__(algorithm) | ||
| self._fetcher = JwksFetcher(jwks_url, cache_ttl) | ||
| def _fetch_key(self, key_id=None): | ||
| return self._fetcher.get_key(key_id) | ||
| class TokenVerifier: | ||
@@ -245,0 +246,0 @@ """Class that verifies ID tokens following the steps defined in the OpenID Connect spec. |
@@ -72,2 +72,10 @@ import json | ||
| def test_asymmetric_verifier_uses_default_jwks_cache_ttl(self): | ||
| verifier = AsymmetricSignatureVerifier("some URL") | ||
| self.assertEqual(verifier._fetcher._cache_ttl, JwksFetcher.CACHE_TTL) | ||
| def test_asymmetric_verifier_uses_provided_jwks_cache_ttl(self): | ||
| verifier = AsymmetricSignatureVerifier("some URL", cache_ttl=3600) | ||
| self.assertEqual(verifier._fetcher._cache_ttl, 3600) | ||
| def test_symmetric_verifier_fetches_key(self): | ||
@@ -74,0 +82,0 @@ verifier = SymmetricSignatureVerifier("some secret") |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: auth0-python | ||
| Version: 4.1.1 | ||
| Version: 4.2.0 | ||
| Summary: Auth0 Python SDK | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/auth0/auth0-python |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
477012
0.12%9909
0.07%