HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/jwt/__pycache__/__main__.cpython-38.pyc
U

�b�[B�@slddlmZmZddlZddlZddlZddlZddlmZm	Z	m
Z
mZdd�Zdd�Z
d	d
�Zdd�ZdS)
�)�absolute_import�print_functionN�)�DecodeError�__version__�decode�encodec	Cs�|jdkrtd��i}|jD]�}|�dd�\}}|dkrp|ddkrpt|�dkrpttt��t|dd����}|��r�t|�}n"zt	|�}Wntk
r�YnXdddd	�}||kr�||}|||<qt
||j|jd
�}|�d�S)Nz4Key is required when encoding. See --help for usage.�=rZexpr�+TF)�trueZfalseZnull)�key�	algorithm�utf-8)
r�
ValueError�payload�split�len�str�int�time�isdigit�floatrr
r)�argsr�arg�k�vZ	constants�token�r�./usr/lib/python3/dist-packages/jwt/__main__.py�encode_payload
s.

  

�rc
Cs�zX|jr|j}n"tj��r*tj����}ntd��|�d�}t||j	|j
d�}t�|�WSt
k
r�}zt
d|��W5d}~XYnXdS)Nz*Cannot read from stdin: terminal not a TTYr)r�verifyz)There was an error decoding the token: %s)r�sys�stdin�isatty�readline�strip�IOErrorrrrr �json�dumpsr)rr�data�errr�decode_payload7s

r+cCs�d}tjd|d�}|jddddtd�|jd	d
dddd
�|jdddddd
�|jdddd�}|jddd�}d}|jdd|d�|jtd�|jdd d�}|jd!d"d#d$�|jd%d&d'd(d)d*d+�|jtd�|S),Na
    Encodes or decodes JSON Web Tokens based on input.

    %(prog)s [options] <command> [options] input

    Decoding examples:

    %(prog)s --key=secret decode json.web.token
    %(prog)s decode --no-verify json.web.token

    Encoding requires the key option and takes space separated key/value pairs
    separated by equals (=) as input. Examples:

    %(prog)s --key=secret encode iss=me exp=1302049071
    %(prog)s --key=secret encode foo=bar exp=+10

    The exp key is special and can take an offset to current Unix time.
    Zpyjwt)�prog�usagez-vz	--version�versionz	%(prog)s )�actionr.z--keyrZKEYzset the secret key to sign with)�dest�metavar�default�helpz--algr
ZALGZHS256z0set crypto algorithm to sign with. default=HS256zPyJWT subcommandszvalid subcommandszadditional help)�titleZdescriptionr3rz use to encode a supplied payload)r3zfPayload to encode. Must be a space separated list of key/value
    pairs separated by equals (=) sign.rr
)�nargsr3)�funcrz'use to decode a supplied JSON web tokenrzJSON web token to decode.�?)r3r5z-nz--no-verifyZstore_falser Tz2ignore signature and claims verification on decode)r/r0r2r3)	�argparse�ArgumentParser�add_argumentrZadd_subparsersZ
add_parserZset_defaultsrr+)r-�
arg_parserZ
subparsersZ
encode_parserZpayload_helpZ
decode_parserrrr�build_argparserJsd�������r<c
Csjt�}z*|�tjdd��}|�|�}t|�Wn4tk
rd}ztd|�|��W5d}~XYnXdS)NrzThere was an unforseen error: )r<�
parse_argsr!�argvr6�print�	ExceptionZ
print_help)r;Z	arguments�outputr*rrr�main�s

rB)Z
__future__rrr8r'r!r�rrrrrr+r<rBrrrr�<module>s*S