zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
U
ß=®db    ã@sddlZddlZddlmZddlmZddlmZddlm    Z    ddl
m Z ddl m Z Gd    d
„d
e ƒZGd d „d ee ƒZGd d„dee ƒZdS)éNé)Ú _CompactJSON)Ú base64_decode)Ú base64_encode)Ú
BadPayload)Ú
Serializer)ÚTimedSerializercs\eZdZdZeZddœeejej    ejejejdœ‡fdd„Z
ejedœ‡fdd    „ Z ‡Z S)
ÚURLSafeSerializerMixinzÌMixed in with a regular serializer it will attempt to zlib
    compress the string to make it shorter if necessary. It will also
    base64 encode the string so that it can safely be placed in a URL.
    N)Ú
serializer)ÚpayloadÚargsr
ÚkwargsÚreturnc
s´d}| d¡r|dd…}d}z t|ƒ}Wn0tk
rZ}ztd|d|‚W5d}~XYnX|r zt |¡}Wn0tk
rž}ztd|d|‚W5d}~XYnXtƒj|f|ž|ŽS)NFó.rTz;Could not base64 decode the payload because of an exception)Úoriginal_errorzACould not zlib decompress the payload before decoding the payload)Ú
startswithrÚ    ExceptionrÚzlibÚ
decompressÚsuperÚ load_payload)Úselfr r
r r rÚjsonÚe©Ú    __class__©úLd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\itsdangerous/url_safe.pyrs0
  þýþýz#URLSafeSerializerMixin.load_payload)ÚobjrcsNtƒ |¡}d}t |¡}t|ƒt|ƒdkr6|}d}t|ƒ}|rJd|}|S)NFrTr)rÚ dump_payloadrÚcompressÚlenr)rrrZ is_compressedÚ
compressedZbase64drrrr4s 
z#URLSafeSerializerMixin.dump_payload) Ú__name__Ú
__module__Ú __qualname__Ú__doc__rZdefault_serializerÚbytesÚ_tÚAnyÚOptionalrrÚ __classcell__rrrrr     sü
ú r    c@seZdZdZdS)ÚURLSafeSerializerzÀWorks like :class:`.Serializer` but dumps and loads into a URL
    safe string consisting of the upper and lowercase character of the
    alphabet as well as ``'_'``, ``'-'`` and ``'.'``.
    N©r#r$r%r&rrrrr,Esr,c@seZdZdZdS)ÚURLSafeTimedSerializerzÅWorks like :class:`.TimedSerializer` but dumps and loads into a
    URL safe string consisting of the upper and lowercase character of
    the alphabet as well as ``'_'``, ``'-'`` and ``'.'``.
    Nr-rrrrr.Lsr.)Útypingr(rÚ_jsonrÚencodingrrÚexcrr
rZtimedrr    r,r.rrrrÚ<module>s      9