Files
loustique-home/venv/lib/python3.11/site-packages/itsdangerous/__pycache__/timed.cpython-311.pyc

75 lines
9.5 KiB
Plaintext
Raw Normal View History

2026-03-21 10:53:02 +01:00
<EFBFBD>
<00><><EFBFBD>i<EFBFBD><00><01><00>ddlmZddlmZddlZddlZddlmZddlm Z ddl
m Z ddl
m Z ddl
m Z dd l
mZdd
l
mZdd lmZdd lmZdd lmZddlmZddlmZddlmZGd<11>de<18><00>ZGd<13>dee<00><00>ZdS)<15>)<01> annotationsN)<01>datetime)<01>timezone<6E>)<01> base64_decode)<01> base64_encode)<01> bytes_to_int)<01> int_to_bytes)<01>
want_bytes)<01> BadSignature)<01>BadTimeSignature)<01>SignatureExpired)<01> _TSerialized)<01>
Serializer)<01>Signerc<01><><00><00>eZdZdZdd<04>Zdd<07>Zdd <0B>Zej dd d<13><05><00>Z ej d!d"d<17><05><00>Z dd#<23>fd<1A> Z d$d%d<1B>Z
<EFBFBD>xZ S)&<26>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.
<20>return<72>intc<01>B<00>ttj<00><00><00><00>S)zTReturns the current timestamp. The function must return an
integer.
)r<00>time)<01>selfs <20>^/home/maxime/Documents/loustiques-home/venv/lib/python3.11/site-packages/itsdangerous/timed.py<70> get_timestampzTimestampSigner.get_timestamps<00><00><13>4<EFBFBD>9<EFBFBD>;<3B>;<3B><1F><1F><1F><00>tsrc<01>B<00>tj|tj<00><01><00>S)a Convert the timestamp from :meth:`get_timestamp` into an
aware :class`datetime.datetime` in UTC.
.. versionchanged:: 2.0
The timestamp is returned as a timezone-aware ``datetime``
in UTC rather than a naive ``datetime`` assumed to be UTC.
)<01>tz)r<00> fromtimestampr<00>utc)rrs r<00>timestamp_to_datetimez%TimestampSigner.timestamp_to_datetime#s<00><00><18>%<25>b<EFBFBD>X<EFBFBD>\<5C>:<3A>:<3A>:<3A>:r<00>value<75> str | bytes<65>bytesc<01><><00>t|<01><00>}tt|<00><00><00><00><00><00><00>}t|j<00><00>}||z|z}||z|<00>|<01><00>zS)z:Signs the given string and also attaches time information.)r rr
r<00>sep<65> get_signature)rr"<00> timestampr&s r<00>signzTimestampSigner.sign-sj<00><00><1A>5<EFBFBD>!<21>!<21><05>!<21>,<2C>t<EFBFBD>/A<>/A<>/C<>/C<>"D<>"D<>E<>E<> <09><18><14><18>"<22>"<22><03><15><03> <0B>i<EFBFBD>'<27><05><14>s<EFBFBD>{<7B>T<EFBFBD>/<2F>/<2F><05>6<>6<>6<>6rNF<4E> signed_value<75>max_age<67>
int | None<6E>return_timestamp<6D>t.Literal[False]c<01><00>dS<00>N<><00>rr*r+r-s r<00>unsignzTimestampSigner.unsign8s <00><00> <14>rT<>t.Literal[True]<5D>tuple[bytes, datetime]c<01><00>dSr0r1r2s rr3zTimestampSigner.unsign@s <00><00> "%<25>r<00>bool<6F>tuple[bytes, datetime] | bytesc<01><><00><01> t<00><00><00>|<01><00>}d}n"#t$r}|}|jpd}Yd}~nd}~wwxYwt |j<00><00>}||vr|r|<05>t d|<04><04><00><00>|<04>|d<05><00>\}} d}
d} tt| <09><00><00><00>}
n#t$rYnwxYw|<05>i|
<EFBFBD>H |<00> |
<EFBFBD><00>} n1#tttf$r} t d|<08><04><00>| <0C>d} ~ wwxYwt t|<05><00>|| <0B><07><00><00>|
<EFBFBD>t d|<08><04><00><00>|<02>x|<00><00><00>|
z
} | |kr,t#d| <0A>d |<02>d
<EFBFBD>||<00> |
<EFBFBD><00><00><07><00><00>| d kr)t#d| <0A>d <0C>||<00> |
<EFBFBD><00><00><07><00><00>|r||<00> |
<EFBFBD><00>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 an aware
:class:`datetime.datetime` object in UTC.
.. versionchanged:: 2.0
The timestamp is returned as a timezone-aware ``datetime``
in UTC rather than a naive ``datetime`` assumed to be UTC.
Nrztimestamp missing)<01>payloadrzMalformed timestamp)r:<00> date_signedzSignature age z > z secondsrz < 0 seconds)<12>superr3r r:r r&r <00>rsplitr r<00> Exceptionr!<00>
ValueError<EFBFBD>OSError<6F> OverflowError<6F>strrr)rr*r+r-<00>result<6C> sig_error<6F>er&r"<00>ts_bytes<65>ts_int<6E>ts_dt<64>exc<78>age<67> __class__s <20>rr3zTimestampSigner.unsignHsu<00><><00>  &<26><1A>W<EFBFBD>W<EFBFBD>^<5E>^<5E>L<EFBFBD>1<>1<>F<EFBFBD><1C>I<EFBFBD>I<EFBFBD><49><1B> &<26> &<26> &<26><19>I<EFBFBD><16>Y<EFBFBD>%<25>#<23>F<EFBFBD>F<EFBFBD>F<EFBFBD>F<EFBFBD>F<EFBFBD>F<EFBFBD><46><EFBFBD><EFBFBD><EFBFBD> &<26><><EFBFBD><EFBFBD><19><14><18>"<22>"<22><03> <0F>f<EFBFBD> <1C> <1C><18> <20><1F><0F>"<22>#6<><06>G<>G<>G<> G<> <20>-<2D>-<2D><03>Q<EFBFBD>/<2F>/<2F><0F><05>x<EFBFBD>!<21><06>!%<25><05> <11>!<21>-<2D><08>"9<>"9<>:<3A>:<3A>F<EFBFBD>F<EFBFBD><46><18> <11> <11> <11> <10>D<EFBFBD> <11><><EFBFBD><EFBFBD>
<15> <20><15>!<21><1F> <20>6<>6<>v<EFBFBD>><3E>><3E>E<EFBFBD>E<EFBFBD><45>"<22>G<EFBFBD>]<5D>;<3B><1F><1F><1F>+<2B>-<2D>u<EFBFBD><16><16><16><1E><1F><><EFBFBD><EFBFBD><EFBFBD><1F><><EFBFBD><EFBFBD>#<23>3<EFBFBD>y<EFBFBD>><3E>><3E>5<EFBFBD>e<EFBFBD>T<>T<>T<> T<> <12>><3E>"<22>#8<>%<25>H<>H<>H<> H<> <13> <1E><16>$<24>$<24>&<26>&<26><16>/<2F>C<EFBFBD><12>W<EFBFBD>}<7D>}<7D>&<26>><3E>S<EFBFBD>><3E>><3E>W<EFBFBD>><3E>><3E>><3E>!<21> $<24> :<3A> :<3A>6<EFBFBD> B<> B<><12><12><12><12> <13>Q<EFBFBD>w<EFBFBD>w<EFBFBD>&<26>6<>S<EFBFBD>6<>6<>6<>!<21> $<24> :<3A> :<3A>6<EFBFBD> B<> B<><12><12><12><12> <1C> =<3D><18>$<24>4<>4<>V<EFBFBD><<3C><<3C><<3C> <<3C><14> s><00>#'<00>
A<03> A<03>A<03>B1<00>1
B><03>=B><03>C<00>D
<03>3D<03>D
c<01>X<00> |<00>||<02><01><00>dS#t$rYdSwxYw)zeOnly validates the given signed value. Returns ``True`` if
the signature exists and is valid.)r+TF)r3r )rr*r+s r<00>validatezTimestampSigner.validate<74>sD<00><00> <19> <10>K<EFBFBD>K<EFBFBD> <0C>g<EFBFBD>K<EFBFBD> 6<> 6<> 6<><17>4<EFBFBD><34><1B> <19> <19> <19><18>5<EFBFBD>5<EFBFBD> <19><><EFBFBD>s <00><00>
)<03>))rr)rrrr)r"r#rr$)NF)r*r#r+r,r-r.rr$)NT)r*r#r+r,r-r4rr5)r*r#r+r,r-r7rr8r0)r*r#r+r,rr7) <0C>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr!r)<00>t<>overloadr3rM<00> __classcell__<5F>rKs@rrrs<00><><00><00><00><00><00><08><08>  <20> <20> <20> <20> ;<3B>;<3B>;<3B>;<3B>7<>7<>7<>7<><07>Z<EFBFBD>#<23>-2<> <14><14><14><14><10>Z<EFBFBD><14><07>Z<EFBFBD>#<23>,0<> %<25>%<25>%<25>%<25><10>Z<EFBFBD>%<25>#<23>!&<26> V<15>V<15>V<15>V<15>V<15>V<15>V<15>p<19><19><19><19><19><19><19><19>rrc<01>V<00><00>eZdZUdZeZded< dd<16>fd <09> Z ddd<12>Z ddd<14>Z <09>xZ
S)<1B>TimedSerializerzOUses :class:`TimestampSigner` instead of the default
:class:`.Signer`.
ztype[TimestampSigner]<5D>default_signerN<72>salt<6C>str | bytes | Noner<00>cabc.Iterator[TimestampSigner]c<01>l<00><01>tjdt<00><00><00>|<01><00><00><00>S)Nr[)rR<00>castr<<00>iter_unsigners)rrYrKs <20>rr^zTimedSerializer.iter_unsigners<72>s*<00><><00><11>v<EFBFBD>6<><05><07><07>8N<38>8N<38>t<EFBFBD>8T<38>8T<38>U<>U<>UrF<>sr#r+r,r-r7<00>t.Anyc<01>F<00>t|<01><00>}d}|<00>|<04><00>D]a} |<06>||d<02><03><00>\}}|<00>|<07><00>} |r| |fcS| cS#t$r<00>t
$r }
|
}Yd}
~
<EFBFBD>Zd}
~
wwxYwt jt
|<05><00><00>)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-)r r^r3<00> load_payloadrr rRr]) rr_r+r-rY<00>last_exception<6F>signer<65>base64dr(r:<00>errs r<00>loadszTimedSerializer.loads<64>s<><00><00> <17>q<EFBFBD>M<EFBFBD>M<EFBFBD><01><1D><0E><1A>)<29>)<29>$<24>/<2F>/<2F> %<25> %<25>F<EFBFBD> %<25>%+<2B>]<5D>]<5D><15>w<EFBFBD><14>&3<>&<12>&<12>"<22><07><19><1F>+<2B>+<2B>G<EFBFBD>4<>4<><07>#<23>.<2E>"<22>I<EFBFBD>-<2D>-<2D>-<2D>-<2D><1E><0E><0E><0E><>#<23> <16> <16> <16><16><1F> %<25> %<25> %<25>!$<24><0E><0E><0E><0E><0E><0E><><EFBFBD><EFBFBD><EFBFBD> %<25><><EFBFBD><EFBFBD><10>f<EFBFBD>\<5C>><3E>2<>2<>2s<00>5A&<02>"A&<02>&B<05>:B<05>B<05>tuple[bool, t.Any]c<01>6<00>|<00>||d|i<01><02><00>S)Nr+)<01> load_kwargs)<01>_loads_unsafe_impl)rr_r+rYs r<00> loads_unsafezTimedSerializer.loads_unsafe<66>s$<00><00> <14>&<26>&<26>q<EFBFBD>$<24>Y<EFBFBD><07><P<>&<26>Q<>Q<>Qrr0)rYrZrr[)NFN)
r_r#r+r,r-r7rYrZrr`)NN)r_r#r+r,rYrZrrh) rNrOrPrQrrX<00>__annotations__r^rgrlrTrUs@rrWrW<00>s<><00><><00><00><00><00><00><00><08><08>-<<3C>N<EFBFBD>;<3B>;<3B>;<3B>;<3B>*.<2E>V<01>V<01>V<01>V<01>V<01>V<01>V<01>#<23>!&<26>#'<27> #3<>#3<>#3<>#3<>#3<>P#<23>#'<27> R<01>R<01>R<01>R<01>R<01>R<01>R<01>R<01>RrrW)<1B>
__future__r<00>collections.abc<62>abc<62>cabcr<00>typingrRrr<00>encodingrrr r
r rIr r r<00>
serializerrrrdrrrWr1rr<00><module>rus<><00><01>"<22>"<22>"<22>"<22>"<22>"<22><1E><1E><1E><1E><1E><1E> <0B> <0B> <0B> <0B><12><12><12><12><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>"<22>"<22>"<22>"<22>"<22>"<22>"<22>"<22>"<22>"<22>"<22>"<22> <20> <20> <20> <20> <20> <20><1D><1D><1D><1D><1D><1D>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!<21>$<24>$<24>$<24>$<24>$<24>$<24>"<22>"<22>"<22>"<22>"<22>"<22><1A><1A><1A><1A><1A><1A>Q<19>Q<19>Q<19>Q<19>Q<19>f<EFBFBD>Q<19>Q<19>Q<19>h:R<01>:R<01>:R<01>:R<01>:R<01>j<EFBFBD><1C>.<2E>:R<01>:R<01>:R<01>:R<01>:Rr