Your IP : 3.21.105.222


Current Path : /opt/alt/python37/lib/python3.7/site-packages/jwt/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/jwt/__pycache__/jwks_client.cpython-37.pyc

B

�E�`��@sfddlZddlZddlmZddlmZmZddlm	Z	m
Z
ddlmZ
ddlmZGdd	�d	�ZdS)
�N)�	lru_cache)�Any�List�)�PyJWK�PyJWKSet)�decode_complete)�PyJWKClientErrorc@sneZdZdeeed�dd�Zed�dd�Ze	d�d	d
�Z
eed�dd�Z
eed
�dd�Zeed�dd�ZdS)�PyJWKClientT�)�uri�
cache_keys�max_cached_keyscCs ||_|rt|d�|j�|_dS)N)�maxsize)rr�get_signing_key)�selfrr
r�r�@/opt/alt/python37/lib/python3.7/site-packages/jwt/jwks_client.py�__init__szPyJWKClient.__init__)�returnc	Cs$tj�|j��}t�|�SQRXdS)N)�urllibZrequestZurlopenr�json�load)r�responserrr�
fetch_dataszPyJWKClient.fetch_datacCs|��}t�|�S)N)rrZ	from_dict)r�datarrr�get_jwk_setszPyJWKClient.get_jwk_setcCsN|��}g}x(|jD]}|jdkr|jr|�|�qWt|�dkrJtd��|S)N�sigrz2The JWKS endpoint did not contain any signing keys)r�keysZpublic_key_use�key_id�append�lenr	)rZjwk_set�signing_keysZjwk_set_keyrrr�get_signing_keysszPyJWKClient.get_signing_keys)�kidrcCsB|��}d}x|D]}|j|kr|}PqW|s>td|�d���|S)Nz,Unable to find a signing key that matches: "�")r#rr	)rr$r"Zsigning_key�keyrrrr(s

zPyJWKClient.get_signing_key)�tokenrcCs(t|ddid�}|d}|�|�d��S)NZverify_signatureF)�options�headerr$)�decode_tokenr�get)rr'Z
unverifiedr)rrr�get_signing_key_from_jwt8sz$PyJWKClient.get_signing_key_from_jwtN)Tr)�__name__�
__module__�__qualname__�str�bool�intrrrrrrrr#rr,rrrrr
s
r
)rZurllib.requestr�	functoolsr�typingrrZapi_jwkrrZapi_jwtrr*�
exceptionsr	r
rrrr�<module>s

?>