Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/itsdangerous/__pycache__/timed.cpython-37.pyc

63 lines
4.4 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>/<2F>]<00>@s<>ddlZddlmZddlmZddlmZddlmZddlmZddlmZdd lm Z dd
l
m Z dd l
m Z dd l
m Z dd lmZddlmZGdd<10>de<11>ZGdd<12>de<0F>ZdS)<13>N)<01>datetime<6D>)<01> text_type)<01> base64_decode)<01> base64_encode)<01> bytes_to_int)<01> int_to_bytes)<01>
want_bytes)<01> BadSignature)<01>BadTimeSignature)<01>SignatureExpired)<01>
Serializer)<01>Signerc@s<eZdZdZdd<03>Zdd<05>Zdd<07>Zdd
d <0B>Zdd d <0A>ZdS)<10>TimestampSignerz<72>Works like the regular :class:`.Signer` but also records the time
of the signing and can be used to expire signatures. The
:meth:`unsign` method can raise :exc:`.SignatureExpired` if the
unsigning failed because the signature is expired.
cCs tt<01><01><00>S)zTReturns the current timestamp. The function must return an
integer.
)<02>int<6E>time)<01>self<6C>r<00></tmp/pip-install-c3kgu56x/itsdangerous/itsdangerous/timed.py<70> get_timestampszTimestampSigner.get_timestampcCs
t<00>|<01>S)zaUsed to convert the timestamp from :meth:`get_timestamp` into
a datetime object.
)r<00>utcfromtimestamp)r<00>tsrrr<00>timestamp_to_datetimesz%TimestampSigner.timestamp_to_datetimecCs@t|<01>}tt|<00><03><00><01>}t|j<04>}|||}|||<00>|<01>S)z:Signs the given string and also attaches time information.)r rrr<00>sepZ get_signature)r<00>value<75> timestamprrrr<00>sign$s

 zTimestampSigner.signNFc
Cs(yt<00>||<01>}d}Wn0tk
rD}z|}|jp2d}Wdd}~XYnXt|j<05>}||krl|r`|<05>td|d<04><02>|<04>|d<05>\}}ytt |<08><01>}Wnt
k
r<EFBFBD>d}YnX|dk r<>tt |<05>||d<06><03>|dkr<>td|d<04><02>|dk <09>r|<00> <0C>|} | |k<04>rt d| |f||<00>|<08>d<06><03>|<03>r$||<00>|<08>fS|S) a=Works like the regular :meth:`.Signer.unsign` but can also
validate the time. See the base docstring of the class for
the general behavior. If ``return_timestamp`` is ``True`` the
timestamp of the signature will be returned as a naive
:class:`datetime.datetime` object in UTC.
N<>ztimestamp missing)<01>payloadr)rZ date_signedzMalformed timestampzSignature age %s > %s seconds)r<00>unsignr
rr rr <00>rsplitrr<00> Exceptionrrr r)
rr<00>max_age<67>return_timestamp<6D>resultZ sig_error<6F>errZagerrrr,s> 
 
 
 

zTimestampSigner.unsigncCs,y|j||d<01>dStk
r&dSXdS)zeOnly validates the given signed value. Returns ``True`` if
the signature exists and is valid.)r"TFN)rr
)rZ signed_valuer"rrr<00>validatees
zTimestampSigner.validate)NF)N) <09>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rrrrr&rrrrrs 
9rc@s(eZdZdZeZddd<05>Zd dd<07>ZdS)
<EFBFBD>TimedSerializerzOUses :class:`TimestampSigner` instead of the default
:class:`.Signer`.
NFc Cs<>t|<01>}d}x||<00>|<04>D]n}y.|j||dd<03>\}}|<00>|<07>} |rH| |fS| Stk
r`<00>Yqtk
r<EFBFBD>}
z|
}Wdd}
~
XYqXqW|<05>dS)a<>Reverse of :meth:`dumps`, raises :exc:`.BadSignature` if the
signature validation fails. If a ``max_age`` is provided it will
ensure the signature is not older than that time in seconds. In
case the signature is outdated, :exc:`.SignatureExpired` is
raised. All arguments are forwarded to the signer's
:meth:`~TimestampSigner.unsign` method.
NT)r#)r Ziter_unsignersrZ load_payloadr r
) r<00>sr"r#<00>saltZlast_exception<6F>signerZbase64drr<00>errrrr<00>loadsvs
zTimedSerializer.loadscCsd|i}i}|<00>||||<05>S)Nr")Z_loads_unsafe_impl)rr,r"r-Z load_kwargsZload_payload_kwargsrrr<00> loads_unsafe<66>szTimedSerializer.loads_unsafe)NFN)NN)r'r(r)r*rZdefault_signerr0r1rrrrr+os
r+)rr<00>_compatr<00>encodingrrrrr <00>excr
r r <00>
serializerr r.rrr+rrrr<00><module>s            ^