Your IP : 216.73.216.196


Current Path : /opt/alt/python27/lib/python2.7/site-packages/jwt/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/jwt/__main__.pyo

�
b'[c@@s�ddlmZmZddlZddlZddlZddlZddlmZm	Z	m
Z
mZd�Zd�Z
d�Zd�ZdS(	i(tabsolute_importtprint_functionNi(tDecodeErrort__version__tdecodetencodecC@sO|jdkrtd��ni}x�|jD]�}|jdd�\}}|dkr�|ddkr�t|�dkr�tttj�t|d���}n|j	�r�t|�}n$yt
|�}Wntk
r�nXitd6td6dd	6}||kr||}n|||<q.Wt
|d
|jd|j�}|jd�S(
Ns4Key is required when encoding. See --help for usage.t=itexpit+ttruetfalsetnulltkeyt	algorithmsutf-8(RtNonet
ValueErrortpayloadtsplittlentstrtintttimetisdigittfloattTruetFalseRR
R(targsRtargtktvt	constantsttoken((s=/opt/alt/python27/lib/python2.7/site-packages/jwt/__main__.pytencode_payload
s,.)

	cC@s�y�|jr|j}n3tjj�r?tjj�j�}ntd��|jd�}t|d|j	d|j
�}tj|�SWn#t
k
r�}t
d|��nXdS(Ns*Cannot read from stdin: terminal not a TTYsutf-8Rtverifys)There was an error decoding the token: %s(RtsyststdintisattytreadlinetstriptIOErrorRRRR!tjsontdumpsR(RRtdatate((s=/opt/alt/python27/lib/python2.7/site-packages/jwt/__main__.pytdecode_payload7s	cC@sTd}tjddd|�}|jdddddd	t�|jd
ddd
ddddd�|jdddd
ddddd�|jdddddd�}|jddd�}d}|jdd d!d|�|jd"t�|jd#dd$�}|jd%dd&d d'�|jd(d)dd*dd+dt	dd,�|jd"t
�|S(-Ns
    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.
    tprogtpyjwttusages-vs	--versiontactiontversions	%(prog)s s--keytdestRtmetavartKEYtdefaultthelpsset the secret key to sign withs--algR
tALGtHS256s0set crypto algorithm to sign with. default=HS256ttitlesPyJWT subcommandstdescriptionsvalid subcommandssadditional helpRs use to encode a supplied payloadsfPayload to encode. Must be a space separated list of key/value
    pairs separated by equals (=) sign.RtnargsRtfuncRs'use to decode a supplied JSON web tokenRsJSON web token to decode.t?s-ns--no-verifytstore_falseR!s2ignore signature and claims verification on decode(targparsetArgumentParsertadd_argumentRRtadd_subparserst
add_parsertset_defaultsR RR,(R/t
arg_parsert
subparserst
encode_parsertpayload_helpt
decode_parser((s=/opt/alt/python27/lib/python2.7/site-packages/jwt/__main__.pytbuild_argparserJsR						cC@smt�}y3|jtjd�}|j|�}t|�Wn*tk
rh}td|�|j�nXdS(NisThere was an unforseen error: (RJt
parse_argsR"targvR<tprintt	Exceptiont
print_help(REt	argumentstoutputR+((s=/opt/alt/python27/lib/python2.7/site-packages/jwt/__main__.pytmain�s	
(t
__future__RRR?R(R"RtRRRRR R,RJRR(((s=/opt/alt/python27/lib/python2.7/site-packages/jwt/__main__.pyt<module>s"	*		S