https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/itsdangerous/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/itsdangerous/jws.pyc
�
-/�_c@s8ddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lm
Z
ddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZdefd��YZdefd��YZdS(i����N(tdatetimei(tnumber_types(t_CompactJSON(tjson(t
base64_decode(t
base64_encode(t
want_bytes(tBadData(t	BadHeader(t
BadPayload(tBadSignature(tSignatureExpired(t
Serializer(t
HMACAlgorithm(t
NoneAlgorithmtJSONWebSignatureSerializercBs�eZdZieej�d6eej�d6eej�d6e�d6Z	dZ
eZddddddd�Zded�Zd�Zd�Zddd	�Zd
�Zddd�Zded�Zded
�ZRS(srThis serializer implements JSON Web Signature (JWS) support. Only
    supports the JWS Compact Serialization.
    tHS256tHS384tHS512tnonecCshtj|d|d|d|d|d|d|�|dkrI|j}n||_|j|�|_dS(Nt
secret_keytsaltt
serializertserializer_kwargstsignert
signer_kwargs(Rt__init__tNonetdefault_algorithmtalgorithm_nametmake_algorithmt	algorithm(tselfRRRRRRR((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyR&s
	c
CsCt|�}d|kr'td��n|jdd�\}}yt|�}Wn%tk
rv}tdd|��nXyt|�}Wn%tk
r�}tdd|��nXytj||dt�}	Wn%t	k
r�}tdd|��nXt
|	t�std	d
|	��ntj||d|�}|r?||	fS|S(Nt.sNo "." found in valueis:Could not base64 decode the header because of an exceptiontoriginal_errors;Could not base64 decode the payload because of an exceptionRs5Could not unserialize header because it was malformeds#Header payload is not a JSON objecttheader(RR	tsplitRt	ExceptionRRtload_payloadRRt
isinstancetdict(
R tpayloadRt
return_headertbase64d_headertbase64d_payloadtjson_headertetjson_payloadR#((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyR&>s8



cCsHt|jj||j��}t|jj||j��}|d|S(NR!(RRtdumpsR(R R#tobjR+R,((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pytdump_payload_s
cCs3y|j|SWntk
r.td��nXdS(NsAlgorithm not supported(tjws_algorithmstKeyErrortNotImplementedError(R R((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyRhs
c
Csp|dkr|j}n|dkr*dnd}|dkrH|j}n|j|jd|ddd|d|�S(NRRtsepR!tkey_derivationR(RRRRR(R RRR7((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pytmake_signerns	cCs)|r|j�ni}|j|d<|S(Ntalg(tcopyR(R t
header_fieldsR#((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pytmake_header|s
cCs=|j|�}|j||j�}|j|j||��S(s�Like :meth:`.Serializer.dumps` but creates a JSON Web
        Signature. It also allows for specifying additional fields to be
        included in the JWS header.
        (R<R8RtsignR2(R R1RR;R#R((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyR0�scCs�|j|j||j�jt|��dt�\}}|jd�|jkrltdd|d|��n|r|||fS|S(s{Reverse of :meth:`dumps`. If requested via ``return_header``
        it will return a tuple of payload and header.
        R*R9sAlgorithm mismatchR#R)(	R&R8RtunsignRtTruetgetRR(R tsRR*R)R#((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pytloads�s$
cCs#i|d6}|j||||�S(NR*(t_loads_unsafe_impl(R RARR*tkwargs((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pytloads_unsafe�s
N(t__name__t
__module__t__doc__R
thashlibtsha256tsha384tsha512RR3RRtdefault_serializerRRtFalseR&R2RR8R<R0RBRE(((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyRs,
!					tTimedJSONWebSignatureSerializercBsJeZdZdZdd�Zd�Zded�Zd�Z	d�Z
RS(s�Works like the regular :class:`JSONWebSignatureSerializer` but
    also records the time of the signing and can be used to expire
    signatures.

    JWS currently does not specify this behavior but it mentions a
    possible extension like this in the spec. Expiry date is encoded
    into the header similar to what's specified in `draft-ietf-oauth
    -json-web-token <http://self-issued.info/docs/draft-ietf-oauth-json
    -web-token.html#expDef>`_.
    icKs8tj|||�|dkr+|j}n||_dS(N(RRRtDEFAULT_EXPIRES_INt
expires_in(R RRQRD((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyR�scCsCtj||�}|j�}||j}||d<||d<|S(Ntiattexp(RR<tnowRQ(R R;R#RRRS((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyR<�s


cCs�tj|||dt�\}}d|krBtdd|��ntdd|�}yt|d�|d<Wntk
r�|�nX|ddkr�|�n|d|j�kr�tdd|d|j	|���n|r�||fS|S(	NR*RSsMissing expiry dateR)sExpiry date is not an IntDateisSignature expiredtdate_signed(
RRBR?R
Rtintt
ValueErrorRTRtget_issue_date(R RARR*R)R#tint_date_error((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyRB�s&

	
cCs5|jd�}t|t�r1tjt|��SdS(NRR(R@R'RRtutcfromtimestampRV(R R#trv((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyRX�scCsttj��S(N(RVttime(R ((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyRT�sN(RFRGRHRPRRR<RNRBRXRT(((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyRO�s
		(RIR\Rt_compatRt_jsonRRtencodingRRRtexcRRR	R
RRRRR
RRRO(((s8/tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/jws.pyt<module>s$�

https://t.me/AnonymousX5 - 2025