Your IP : 3.15.218.44


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/jwt/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/jwt/__pycache__/api_jwt.cpython-311.pyc

�

O�Dg�����ddlZddlmZddlmZmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZddlmZddlmZmZmZmZmZmZmZGd	�d
��Ze��ZejZejZejZdS)�N)�timegm)�Iterable�Mapping)�datetime�	timedelta)�Any�Dict�List�Optional�Type�Union�)�api_jws)�DecodeError�ExpiredSignatureError�ImmatureSignatureError�InvalidAudienceError�InvalidIssuedAtError�InvalidIssuerError�MissingRequiredClaimErrorc
�r�eZdZdd�Zedeeeee	efffd���Z
			ddeeefdeded	eed
ee
ejdefd�Z			dd
edede	ededeeeff
d�Z			dd
edede	ededeeeff
d�Z	dd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�PyJWTNc�H�|�i}i|����|�|_dS�N)�_get_default_options�options)�selfrs  �k/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/jwt/api_jwt.py�__init__zPyJWT.__init__s-���?��G�A�$�3�3�5�5�A��A������returnc��ddddddgd�S)NT)�verify_signature�
verify_exp�
verify_nbf�
verify_iat�
verify_aud�
verify_iss�require�r*r rrzPyJWT._get_default_optionss(��!%�������
�
�	
r �HS256�payload�key�	algorithm�headers�json_encoderc��t|t��std���|���}dD]T}t|�|��t
��r*t
||�����||<�Utj	|d|����
d��}tj
|||||��S)NzJExpecting a mapping object, as JWT only supports JSON objects as payloads.)�exp�iat�nbf)�,�:)�
separators�clszutf-8)�
isinstancer�	TypeError�copy�getrr�utctimetuple�json�dumps�encoder)rr,r-r.r/r0�
time_claim�json_payloads        rr@zPyJWT.encode%s����'�7�+�+�	��,���
��,�,�.�.��/�	Q�	Q�J��'�+�+�j�1�1�8�<�<�
Q�&,�W�Z�-@�-M�-M�-O�-O�&P�&P��
�#���z��
��
�
�
�
�&��/�/�	��~�l�C��G�\�R�R�Rr ��jwt�
algorithmsrc��|�ddi}n|�dd��|dsn|�dd��|�dd��|�dd��|�dd��|�dd��|dr|std	���tj|f|||d
�|��}	t	j|d��}n$#t$r}td|z���d}~wwxYwt|t��std
���i|j	�|�}	|j
||	fi|��||d<|S)Nr#Tr$Fr%r&r'r(z\It is required that you pass in a value for the "algorithms" argument when calling decode().)r-rErr,zInvalid payload string: %sz-Invalid payload string: must be a json object)�
setdefaultrr�decode_completer>�loads�
ValueErrorr9�dictr�_validate_claims)
rrDr-rEr�kwargs�decodedr,�e�merged_optionss
          rrHzPyJWT.decode_completeAs����?�)�4�0�G�G����1�4�8�8�8��)�*�	4����|�U�3�3�3����|�U�3�3�3����|�U�3�3�3����|�U�3�3�3����|�U�3�3�3��%�&�	�z�	��n���
��)��
��!��	
�
�
�
�
��	@��j���!3�4�4�G�G���	@�	@�	@��:�Q�>�?�?�?�����	@�����'�4�(�(�	O��M�N�N�N�4�D�L�4�G�4�����g�~�@�@��@�@�@�$��	���s�C�
D�)C;�;Dc�4�|j||||fi|��}|dS)Nr,)rH)rrDr-rErrMrNs       r�decodezPyJWT.decodeos/��'�$�&�s�C��W�O�O��O�O���y�!�!r rc��t|t��r|���}t|tttd��tf��std���|�||��ttj�������}d|vr|dr|�
|||��d|vr|dr|�|||��d|vr|dr|�|||��|dr|�||��|d	r|�||��dSdS)
Nz,audience must be a string, iterable, or Noner3r&r4r%r2r$r(r')r9r�
total_seconds�bytes�str�typerr:�_validate_required_claimsrr�utcnowr=�
_validate_iat�
_validate_nbf�
_validate_exp�
_validate_iss�
_validate_aud)rr,r�audience�issuer�leewayrM�nows        rrLzPyJWT._validate_claimszsl���f�i�(�(�	,��)�)�+�+�F��(�U�C��d���X�$F�G�G�	L��J�K�K�K��&�&�w��8�8�8��X�_�&�&�3�3�5�5�6�6���G����� 5�����w��V�4�4�4��G����� 5�����w��V�4�4�4��G����� 5�����w��V�4�4�4��<� �	0����w��/�/�/��<� �	2����w��1�1�1�1�1�	2�	2r c�d�|dD]&}|�|���t|����'dS)Nr))r<r)rr,r�claims    rrXzPyJWT._validate_required_claims�sE���Y�'�	7�	7�E��{�{�5�!�!�)�/��6�6�6�*�	7�	7r c�l�	t|d��dS#t$rtd���wxYw)Nr3z)Issued At claim (iat) must be an integer.)�intrJr)rr,rbras    rrZzPyJWT._validate_iat�sN��	T������������	T�	T�	T�&�'R�S�S�S�	T���s��3c��	t|d��}n#t$rtd���wxYw|||zkrtd���dS)Nr4z*Not Before claim (nbf) must be an integer.z The token is not yet valid (nbf))rfrJrr)rr,rbrar4s     rr[zPyJWT._validate_nbf�sq��	L��g�e�n�%�%�C�C���	L�	L�	L��J�K�K�K�	L�����#��,���(�)K�L�L�L� ����2c��	t|d��}n#t$rtd���wxYw|||z
krtd���dS)Nr2z/Expiration Time claim (exp) must be an integer.zSignature has expired)rfrJrr)rr,rbrar2s     rr\zPyJWT._validate_exp�sq��	T��g�e�n�%�%�C�C���	T�	T�	T��R�S�S�S�	T�����#��,���'�(?�@�@�@� �rhc����|�d|vrdS|�d|vrtd���|�d|vrtd���|d�t�t��r�g�t�t��std���td��D����rtd���t|t��r|g}t�fd�|D����std���dS)N�audzInvalid audiencezInvalid claim format in tokenc3�BK�|]}t|t��V��dSr)r9rV)�.0�cs  r�	<genexpr>z&PyJWT._validate_aud.<locals>.<genexpr>�s/����?�?�!�:�a��%�%�%�?�?�?�?�?�?r c3� �K�|]}|�vV��	dSrr*)rmrk�audience_claimss  �rroz&PyJWT._validate_aud.<locals>.<genexpr>�s(�����>�>�c�3�/�)�>�>�>�>�>�>r )rrr9rV�list�any)rr,r_rqs   @rr^zPyJWT._validate_aud�s$������W� 4� 4��F���E��$8�$8�,�E�2�2�2����� 0� 0�'�'9�:�:�:�!�%�.���o�s�+�+�	0�.�/�O��/�4�0�0�	H�&�'F�G�G�G��?�?��?�?�?�?�?�	H�&�'F�G�G�G��h��$�$�	"� �z�H��>�>�>�>�X�>�>�>�>�>�	;�&�'9�:�:�:�	;�	;r c�j�|�dSd|vrtd���|d|krtd���dS)N�isszInvalid issuer)rr)rr,r`s   rr]zPyJWT._validate_iss�sK���>��F�����+�E�2�2�2��5�>�V�#�#�$�%5�6�6�6�$�#r r)r+NN)rCNN)NNr)�__name__�
__module__�__qualname__r�staticmethodr	rVr
�boolr
rrrrr>�JSONEncoderr@rHrRrLrXrZr[r\r^r]r*r rrrs+������B�B�B�B�
�	
�$�s�E�$��S�	�/�,B�'B�"C�	
�	
�	
��\�	
�!�"&�9=�
S�S��c�3�h��S��S��	S�
�$��S��t�D�$4�5�6�
S�

�S�S�S�S�>� $��,�,�
�,��,���I�	,�
�,�
�c�3�h��,�,�,�,�b� $��	"�	"�
�	"��	"���I�		"�
�	"�
�c�3�h��	"�	"�	"�	"�DE�2�2�2�2�87�7�7�
T�T�T�M�M�M�A�A�A�;�;�;�:7�7�7�7�7r r)r>�calendarr�collections.abcrrrr�typingrr	r
rrr
rCr�
exceptionsrrrrrrrr�_jwt_global_objr@rHrRr*r r�<module>r�sF������������-�-�-�-�-�-�-�-�(�(�(�(�(�(�(�(�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�������������������������E7�E7�E7�E7�E7�E7�E7�E7�P�%�'�'��	�	��!�1��	�	���r 

?>