HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/clcommon/lib/__pycache__/jwt_token.cpython-37.pyc
B

|��HI�ޫ�@s:ddlmZmZddlmZdd�Zddd�Zdd	�Zd
S)�)�decode�
exceptions)�DEFAULT_JWT_ES_TOKEN_PATHc	Cs(t|dd��}|����}WdQRX|S)N�rb)�mode)�open�read�strip)Zjwt_path�f�token_string�r��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.1-1.el9.cloudlinux.x86_64/opt/alt/python37/lib/python3.7/site-packages/clcommon/lib/jwt_token.py�read_jwtsrTcCs2t|dgd|ddd�dd�}d|kr.t�d��|S)NZHS256TF)Zrequire_exp�
verify_expZ
verify_issZverify_signatureZ
CloudLinux)Z
algorithmsZoptionsZissuerZexp)rrZMissingRequiredClaimError)rr�	jwt_tokenrrr
�
decode_jwts
rc	Cs�d\}}}ytt�}Wn$ttfk
r:dd�t�dfSXy:t|�}|�d�dkr`d\}}}n|�d�std\}}}Wn\tjk
r�d\}}}Yn>tj	k
r�d	\}}}Yn tj
k
r�d\}}}YnX|||fS)
z�
    JWT token check
    :return: Tuple: success_flag, error_message, token_string
     success_flag: True/False - OK, JWT is valid/Error, invalid
     error_message: Error message
     token_string: Token string
    )TZOKNFzJWT file {} read errorNZcl_plus)FzJWT token format errorN)Fz"JWT token doesn't have CL+ serviceN)FzJWT token issuer is invalidN)FzJWT token expiredN)rr�OSError�IOError�formatr�getrZInvalidIssuerErrorZExpiredSignatureErrorZ
PyJWTError)Zsuccess_flagZ
error_messagerrrrr
�jwt_token_checks$

rN)T)ZjwtrrZclcommon.lib.constsrrrrrrrr
�<module>s