Files
sirh/venv/lib/python3.12/site-packages/__pycache__/itsdangerous.cpython-312.pyc

256 lines
38 KiB
Plaintext
Raw Normal View History

2026-04-29 11:52:03 +02:00
<EFBFBD>
<00><><EFBFBD>i`|<00><00><><00>dZddlZddlZddlZddlZddlZddlZddlZddlmZejddk(Z
e
rddl m Z e ZeZeeefZn"ddlmZeZ eZej2ddd <09>ZeefZ ddlZGd
<EFBFBD>d e<1D>Ze<1E>Zd Z d9d <0A>Z!d<0E>Z"e#edd<02>Z$d<10>Z%Gd<11>de&<26>Z'Gd<13>de'<27>Z(Gd<15>de'<27>Z)Gd<17>de)<29>Z*Gd<19>de)<29>Z+Gd<1B>de*<2A>Z,d<1D>Z-d<1E>Z.d<1F>Z/d <20>Z0Gd!<21>d"e<1D>Z1Gd#<23>d$e1<65>Z2Gd%<25>d&e1<65>Z3Gd'<27>d(e<1D>Z4Gd)<29>d*e4<65>Z5Gd+<2B>d,e<1D>Z6Gd-<2D>d.e6<65>Z7Gd/<2F>d0e6<65>Z8Gd1<64>d2e8<65>Z9Gd3<64>d4e<1D>Z:Gd5<64>d6e:e6<65>Z;Gd7<64>d8e:e7<65>Z<y#e$rddlZY<00><01> wxYw):a
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2014 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
<EFBFBD>N)<01>datetime<6D>)<01>izip)<01>reduce<63>to_bytes<65><00>bigc<00><00>eZdZdZd<02>Zd<03>Zy)<05> _CompactJSONz6Wrapper around simplejson that strips whitespace.
c<00>,<00>tj|<01>S<00>N)<02>json<6F>loads)<02>self<6C>payloads <20>I/home/fatima/modif/sirh/venv/lib/python3.12/site-packages/itsdangerous.pyrz_CompactJSON.loads/s<00><00><13>z<EFBFBD>z<EFBFBD>'<27>"<22>"<22>c<00>0<00>tj|d<01><02>S)N)<02>,<2C>:)<01>
separators)r<00>dumps<70>r<00>objs rrz_CompactJSON.dumps2s<00><00><13>z<EFBFBD>z<EFBFBD>#<23>*<2A>5<>5rN)<06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr<00>rrr r +s<00><00><08>#<23>6rr i<>nMc<00>J<00>t|t<00>r|j||<02>}|Sr )<03>
isinstance<EFBFBD> text_type<70>encode)<03>s<>encoding<6E>errorss r<00>
want_bytesr'=s!<00><00><11>!<21>Y<EFBFBD><1F> <0A>H<EFBFBD>H<EFBFBD>X<EFBFBD>v<EFBFBD> &<26><01> <0C>Hrc<00>@<00>t|ji<00>t<00>S)z6Checks wheather a serializer generates text or binary.)r!rr"<00><01>
serializers r<00>is_text_serializerr+Cs<00><00> <15>j<EFBFBD>&<26>&<26>r<EFBFBD>*<2A>I<EFBFBD> 6<>6r<00>compare_digestc<00><><00>t<00> t||<01>St|<00>t|<01>k(}|rd}|}nd}|}tt|<04>t|<01><00>D] \}}|||z z}<03>|dk(S)a8Returns True if the two strings are equal, False otherwise.
The time taken is independent of the number of characters that match. Do
not use this function for anything else than comparision with known
length targets.
This is should be implemented in C in order to get it completely right.
rr)<04>_builtin_constant_time_compare<72>lenr<00> bytearray)<07>val1<6C>val2<6C>len_eq<65>result<6C>left<66>x<>ys r<00>constant_time_comparer8Msy<00><00>&<26>1<>-<2D>d<EFBFBD>D<EFBFBD>9<>9<> <10><14>Y<EFBFBD>#<23>d<EFBFBD>)<29> #<23>F<EFBFBD> <0A><12><06><13><04><12><06><13><04><14>Y<EFBFBD>t<EFBFBD>_<EFBFBD>i<EFBFBD><04>o<EFBFBD>6<><18><04><01>1<EFBFBD><0E>!<21>a<EFBFBD>%<25><0F><06><18> <11>Q<EFBFBD>;<3B>rc<00>0<00>eZdZdZdZd<03>Zd<04>ZereZd<05>Zyy)<06>BadDataz<61>Raised if bad data of any sort was encountered. This is the
base for all exceptions that itsdangerous is currently using.
.. versionadded:: 0.15
Nc<00>><00>tj||<01>||_yr )<03> Exception<6F>__init__<5F>message)rr>s rr=zBadData.__init__ls<00><00><11><1A><1A>4<EFBFBD><17>)<29><1E><04> rc<00>,<00>t|j<00>Sr )r"r><00>rs r<00>__str__zBadData.__str__ps<00><00><18><14><1C><1C>&<26>&rc<00>@<00>|j<00>jd<01>S)N<>utf-8)<02> __unicode__r#r@s rrAzBadData.__str__us<00><00><17>#<23>#<23>%<25>,<2C>,<2C>W<EFBFBD>5<> 5r) rrrrr>r=rA<00>PY2rDrrrr:r:ds,<00><00><08>
<13>G<EFBFBD><1F>'<27> <0B><1D> <0B> 6<> rr:c<00><00>eZdZdZdd<03>Zy)<05>
BadPayloada<EFBFBD>This error is raised in situations when payload is loaded without
checking the signature first and an exception happend as a result of
that. The original exception that caused that will be stored on the
exception as :attr:`original_error`.
This can also happen with a :class:`JSONWebSignatureSerializer` that
is subclassed and uses a different serializer for the payload than
the expected one.
.. versionadded:: 0.15
Nc<00>><00>tj||<01>||_yr )r:r=<00>original_error)rr>rIs rr=zBadPayload.__init__<5F>s<00><00><0F><18><18><14>w<EFBFBD>'<27>-<2D><04>rr <00>rrrrr=rrrrGrGys <00><00>
<08>-rrGc<00><00>eZdZdZdd<03>Zy)<05> BadSignaturez<65>This error is raised if a signature does not match. As of
itsdangerous 0.14 there are helpful attributes on the exception
instances. You can also catch down the baseclass :exc:`BadData`.
Nc<00>><00>tj||<01>||_yr )r:r=r)rr>rs rr=zBadSignature.__init__<5F>s<00><00><0F><18><18><14>w<EFBFBD>'<27> <1F><04> rr rJrrrrLrL<00>s <00><00><08>
rrLc<00><00>eZdZdZdd<03>Zy)<05>BadTimeSignaturez<65>Raised for time based signatures that fail. This is a subclass
of :class:`BadSignature` so you can catch those down as well.
Nc<00>@<00>tj|||<02>||_yr )rLr=<00> date_signed)rr>rrQs rr=zBadTimeSignature.__init__<5F>s<00><00><14><1D><1D>d<EFBFBD>G<EFBFBD>W<EFBFBD>5<>'<27><04>r<00>NNrJrrrrOrO<00>s <00><00><08>'rrOc<00><00>eZdZdZ dd<03>Zy)<05> BadHeaderz<72>Raised if a signed header is invalid in some form. This only
happens for serializers that have a header that goes with the
signature.
.. versionadded:: 0.24
Nc<00>N<00>tj|||<02>||_||_yr )rLr=<00>headerrI)rr>rrVrIs rr=zBadHeader.__init__<5F>s'<00><00><14><1D><1D>d<EFBFBD>G<EFBFBD>W<EFBFBD>5<><1D><04> <0B>-<2D><04>r)NNNrJrrrrTrT<00>s<00><00><08>6:<3A> $<24>
-rrTc<00><00>eZdZdZy)<03>SignatureExpiredz<64>Signature timestamp is older than required max_age. This is a
subclass of :exc:`BadTimeSignature` so you can use the baseclass for
catching the error.
N)rrrrrrrrXrX<00>s<00><00>rrXc<00>`<00>t|<00>}tj|<00>jd<01>S)z<>base64 encodes a single bytestring (and is tolerant to getting
called with a unicode string).
The resulting bytestring is safe for putting into URLs.
<20>=)r'<00>base64<36>urlsafe_b64encode<64>strip<69><01>strings r<00> base64_encoder`<00>s*<00><00>
<18><06> <1F>F<EFBFBD> <11> #<23> #<23>F<EFBFBD> +<2B> 1<> 1<>$<24> 7<>7rc<00>n<00>t|dd<02><03>}tj|dt|<00> dzzz<00>S)z<>base64 decodes a single bytestring (and is tolerant to getting
called with a unicode string).
The result is also a bytestring.
<20>ascii<69>ignore)r%r&rZ<00>)r'r[<00>urlsafe_b64decoder/r^s r<00> base64_decoderf<00>s8<00><00>
<18><06><17><18> B<>F<EFBFBD> <11> #<23> #<23>F<EFBFBD>T<EFBFBD>c<EFBFBD>&<26>k<EFBFBD>\<5C>A<EFBFBD>5E<35>-F<>$F<> G<>Grc<00><><00>|dk\sJ<00>g}|r%|jt|dz<00><00>|dz}|r<01>%djt|<01><00>S)Nr<00><><00>r)<04>append<6E> int_to_byte<74>join<69>reversed)<02>num<75>rvs r<00> int_to_bytesrp<00>sM<00><00> <0E>!<21>8<EFBFBD>O<EFBFBD>8<EFBFBD> <0B>B<EFBFBD>
<0A>
<EFBFBD> <09> <09>+<2B>c<EFBFBD>D<EFBFBD>j<EFBFBD>)<29>*<2A> <0B><01> <09><03> <0E> <0F>8<EFBFBD>8<EFBFBD>H<EFBFBD>R<EFBFBD>L<EFBFBD> !<21>!rc<00>0<00>td<01>t|<00>d<02>S)Nc<00><00>|dz|zS)Nrir)<02>a<>bs r<00><lambda>zbytes_to_int.<locals>.<lambda><3E>s<00><00>q<EFBFBD>A<EFBFBD>v<EFBFBD><01>z<EFBFBD>rr)rr0)<01>bytestrs r<00> bytes_to_intrw<00>s<00><00> <11>)<29>9<EFBFBD>W<EFBFBD>+=<3D>q<EFBFBD> A<>Arc<00><00>eZdZdZd<02>Zd<03>Zy)<05>SigningAlgorithmzzSubclasses of `SigningAlgorithm` have to implement `get_signature` to
provide signature generation functionality.
c<00><00>t<00><00>)z1Returns the signature for the given key and value)<01>NotImplementedError<6F>r<00>key<65>values r<00> get_signaturezSigningAlgorithm.get_signature<72>s <00><00>!<21>#<23>#rc<00>:<00>t||j||<02><00>S)z;Verifies the given signature matches the expected signature)r8r)rr}r~<00>sigs r<00>verify_signaturez!SigningAlgorithm.verify_signature<72>s<00><00>$<24>S<EFBFBD>$<24>*<<3C>*<<3C>S<EFBFBD>%<25>*H<>I<>IrN)rrrrrr<>rrrryry<00>s<00><00><08>$<24>Jrryc<00><00>eZdZdZd<02>Zy)<04> NoneAlgorithmzjThis class provides a algorithm that does not perform any signing and
returns an empty signature.
c<00><00>y)Nrrr|s rrzNoneAlgorithm.get_signature<72>s<00><00>rN)rrrrrrrrr<>r<><00>s <00><00><08>rr<>c<00>B<00>eZdZdZeej <00>Zdd<03>Zd<04>Z y)<06> HMACAlgorithmz5This class provides signature generation using HMACs.Nc<00>.<00>|<01> |j}||_yr )<02>default_digest_method<6F> digest_method)rr<>s rr=zHMACAlgorithm.__init__s<00><00> <18> <20> <20>6<>6<>M<EFBFBD>*<2A><04>rc<00>f<00>tj|||j<00><01>}|j<00>S)N)<02>msg<73> digestmod)<04>hmac<61>newr<77><00>digest)rr}r~<00>macs rrzHMACAlgorithm.get_signature s&<00><00><12>h<EFBFBD>h<EFBFBD>s<EFBFBD><05><14>1C<31>1C<31>D<><03><12>z<EFBFBD>z<EFBFBD>|<7C>rr )
rrrr<00> staticmethod<6F>hashlib<69>sha1r<31>r=rrrrr<>r<><00>s <00><00>?<3F>)<29><17><1C><1C>6<><19>+<2B>
rr<>c<00>h<00>eZdZdZeej <00>ZdZ d d<04>Z d<05>Z
d<06>Z d<07>Z d<08>Z d <09>Zd
<EFBFBD>Zy) <0C>Signera<72>This class can sign bytes and unsign it and validate the signature
provided.
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 where the same
signed value in one part can mean something different in another part
is a security risk.
See :ref:`the-salt` for an example of what the salt is doing and how you
can utilize it.
.. versionadded:: 0.14
`key_derivation` and `digest_method` were added as arguments to the
class constructor.
.. versionadded:: 0.18
`algorithm` was added as an argument to the class constructor.
<20> django-concatNc<00><><00>t|<01>|_||_|<02>dn||_|<04> |j}||_|<05> |j }||_|<06>t|j<00>}||_ y)Nzitsdangerous.Signer)
r'<00>
secret_key<EFBFBD>sep<65>salt<6C>default_key_derivation<6F>key_derivationr<6E>r<>r<><00> algorithm)rr<>r<>r<>r<>r<>r<>s rr=zSigner.__init__3sr<00><00>$<24>Z<EFBFBD>0<><04><0F><16><04><08>-1<>\<5C>)<29>t<EFBFBD><04> <09> <19> !<21>!<21>8<>8<>N<EFBFBD>,<2C><04><1B> <18> <20> <20>6<>6<>M<EFBFBD>*<2A><04><1A> <14> <1C>%<25>d<EFBFBD>&8<>&8<>9<>I<EFBFBD>"<22><04>rc<00> <00>t|j<00>}|jdk(r,|j||jz<00>j <00>S|jdk(r/|j|dz|jz<00>j <00>S|jdk(rLt j|j|j<00><05>}|j|<01>|j <00>S|jdk(r |jStd<07><00>)anThis method is called to derive the key. If you're unhappy with
the default key derivation choices you can override them here.
Keep in mind that the key derivation in itsdangerous is not intended
to be used as a security method to make a complex key out of a short
password. Instead you should use large random secret keys.
<20>concatr<74>ssignerr<72>)r<><00>nonezUnknown key derivation method)
r'r<>r<>r<>r<>r<>r<>r<><00>update<74> TypeError)rr<>r<>s r<00>
derive_keyzSigner.derive_keyBs<><00><00><1A>$<24>)<29>)<29>$<24><04> <0F> <1E> <1E>(<28> *<2A><17>%<25>%<25>d<EFBFBD>T<EFBFBD>_<EFBFBD>_<EFBFBD>&<<3C>=<3D>D<>D<>F<> F<> <11> <20> <20>O<EFBFBD> 3<><17>%<25>%<25>d<EFBFBD>Y<EFBFBD>&6<><14><0F><0F>' <20>!<21>!'<27><16><18> *<2A> <11> <20> <20>F<EFBFBD> *<2A><16>(<28>(<28>4<EFBFBD>?<3F>?<3F>d<EFBFBD>6H<36>6H<36>I<>C<EFBFBD> <0F>J<EFBFBD>J<EFBFBD>t<EFBFBD> <1C><16>:<3A>:<3A><<3C> <1F> <11> <20> <20>F<EFBFBD> *<2A><17>?<3F>?<3F> "<22><1B>;<3B><<3C> <rc<00><><00>t|<01>}|j<00>}|jj||<01>}t |<03>S)z)Returns the signature for the given value)r'r<>r<>rr`)rr~r}r<>s rrzSigner.get_signatureXs9<00><00><1A>5<EFBFBD>!<21><05><12>o<EFBFBD>o<EFBFBD><1F><03><12>n<EFBFBD>n<EFBFBD>*<2A>*<2A>3<EFBFBD><05>6<><03><1C>S<EFBFBD>!<21>!rc<00>V<00>|t|j<00>z|j|<01>zS)zSigns the given string.)r'r<>r)rr~s r<00>signz Signer.sign_s&<00><00><14>z<EFBFBD>$<24>(<28>(<28>+<2B>+<2B>d<EFBFBD>.@<40>.@<40><15>.G<>G<>Grc<00><><00>|j<00>} t|<02>}|jj |||<02>S#t$rYywxYw)z+Verifies the signature for the given value.F)r<>rfr<r<>r<>)rr~r<>r}s rr<>zSigner.verify_signaturecsL<00><00><12>o<EFBFBD>o<EFBFBD><1F><03> <19><1F><03>$<24>C<EFBFBD><14>~<7E>~<7E>.<2E>.<2E>s<EFBFBD>E<EFBFBD>3<EFBFBD>?<3F>?<3F><><19> <19><18> <19>s<00> :<00> A<03>Ac<00><><00>t|<01>}t|j<00>}||vrtd|jz<00><00>|j|d<02>\}}|j ||<04>r|Std|z|<03><04><00>)zUnsigns the given string.zNo %r found in valuerzSignature %r does not match<63>r)r'r<>rL<00>rsplitr<74>)r<00> signed_valuer<65>r~r<>s r<00>unsignz Signer.unsignlsz<00><00>!<21>,<2C>/<2F> <0C><18><14><18><18>"<22><03> <0E>l<EFBFBD> "<22><1E>5<><04><08><08>@<40>A<> A<>!<21>(<28>(<28><13>a<EFBFBD>0<>
<EFBFBD><05>s<EFBFBD> <0F> <20> <20><15><03> ,<2C><18>L<EFBFBD><1A>8<>3<EFBFBD>><3E>#(<28>*<2A> *rc<00>F<00> |j|<01>y#t$rYywxYw)<03>wJust validates the given signed value. Returns `True` if the
signature exists and is valid, `False` otherwise.TF<54>r<>rL)rr<>s r<00>validatezSigner.validatexs(<00><00> <19> <10>K<EFBFBD>K<EFBFBD> <0C> %<25><17><><1B> <19><18> <19>s <00><00> <03> )N<>.NNN)rrrrr<>r<>r<>r<>r<>r=r<>rr<>r<>r<>r<>rrrr<>r<>sK<00><00><08>0)<29><17><1C><1C>6<><19>-<2D><1A>FJ<46>/3<> #<23>=<3D>,"<22>H<01>@<01>
*<2A>rr<>c<00>2<00>eZdZdZd<02>Zd<03>Zd<04>Zdd<06>Zd d<07>Zy)
<EFBFBD>TimestampSignera8Works like the regular :class:`Signer` but also records the time
of the signing and can be used to expire signatures. The unsign
method can rause a :exc:`SignatureExpired` method if the unsigning
failed because the signature is expired. This exception is a subclass
of :exc:`BadSignature`.
c<00>J<00>ttj<00>tz
<00>S)z<>Returns the current timestamp. This implementation returns the
seconds since 1/1/2011. The function must return an integer.
)<03>int<6E>time<6D>EPOCHr@s r<00> get_timestampzTimestampSigner.get_timestamp<6D>s<00><00><13>4<EFBFBD>9<EFBFBD>9<EFBFBD>;<3B><15>&<26>'<27>'rc<00>:<00>tj|tz<00>S)z[Used to convert the timestamp from `get_timestamp` into a
datetime object.
)r<00>utcfromtimestampr<70>)r<00>tss r<00>timestamp_to_datetimez%TimestampSigner.timestamp_to_datetime<6D>s<00><00><18>(<28>(<28><12>e<EFBFBD><1A>4<>4rc<00><><00>t|<01>}tt|j<00><00><00>}t|j<00>}||z|z}||z|j |<01>zS)z<Signs the given string and also attaches a time information.)r'r`rpr<>r<>r)rr~<00> timestampr<70>s rr<>zTimestampSigner.sign<67>sZ<00><00><1A>5<EFBFBD>!<21><05>!<21>,<2C>t<EFBFBD>/A<>/A<>/C<>"D<>E<> <09><18><14><18><18>"<22><03><15><03> <0B>i<EFBFBD>'<27><05><14>s<EFBFBD>{<7B>T<EFBFBD>/<2F>/<2F><05>6<>6<>6rNc<00>H<00> tj||<01>}d}t |j
<00>}||vr|r|<05>t d|<04><04><00>|j|d<05>\}} tt|<08><00>}|<05>t t|<05>||<08><06><00>|<08> t d|<01><04><00>|<02><|j<00>|z
} | |kDr$td| <09>d |<02>d
<EFBFBD>||j|<08><00><06><00>|r||j|<08>fS|S#t$r}|}|jxsd}Yd}~<06><>d}~wwxYw#t$rd}Y<00><>wxYw) 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 set to `True`
the timestamp of the signature will be returned as naive
:class:`datetime.datetime` object in UTC.
Nrztimestamp missingr<67>r<00>rrQzMalformed timestampzSignature age z > z seconds)r<>r<>rLrr'r<>rOr<>rwrfr<r"r<>rXr<>)
rr~<00>max_age<67>return_timestampr4<00> sig_error<6F>er<65>r<><00>ages
rr<>zTimestampSigner.unsign<67>sP<00><00> &<26><1B>]<5D>]<5D>4<EFBFBD><15>/<2F>F<EFBFBD><1C>I<EFBFBD><19><14><18><18>"<22><03><13>f<EFBFBD>}<7D><18><1F><0F>"<22>#6<><06>G<> G<>!<21>=<3D>=<3D><13>a<EFBFBD>0<><18><05>y<EFBFBD> <1D>$<24>]<5D>9<EFBFBD>%=<3D>><3E>I<EFBFBD> <15> <20>"<22>9<EFBFBD>Y<EFBFBD>#7<><15>/8<>:<3A> :<3A>
<15> <1C>"<22>#8<>%<25>H<> H<> <13> <1E><16>$<24>$<24>&<26><19>2<>C<EFBFBD><12>W<EFBFBD>}<7D>&<26>7:<3A>G<EFBFBD>D<>!<21> $<24> :<3A> :<3A>9<EFBFBD> E<>G<01>G<01>
<1C><18>$<24>4<>4<>Y<EFBFBD>?<3F>?<3F> ?<3F><14> <0C><>W<1C> &<26><19>I<EFBFBD><16>Y<EFBFBD>Y<EFBFBD>%<25>#<23>F<EFBFBD><46> &<26><>$<19> <1D><1C>I<EFBFBD> <1D>s)<00>C+<00>D<00>+ D<03>4D <03> D<03> D!<03> D!c<00>J<00> |j||<02><01>y#t$rYywxYw)r<>)r<>TFr<46>)rr<>r<>s rr<>zTimestampSigner.validate<74>s,<00><00> <19> <10>K<EFBFBD>K<EFBFBD> <0C>g<EFBFBD>K<EFBFBD> 6<><17><><1B> <19><18> <19>s <00><00> "<03>"<03>NFr ) rrrrr<>r<>r<>r<>r<>rrrr<>r<><00>s!<00><00><08>(<28> 5<> 7<>5<15>nrr<>c<00>t<00>eZdZdZeZeZ dd<03>Zdd<04>Z d<05>Z
dd<06>Z dd<07>Z dd<08>Z dd <09>Zdd
<EFBFBD>Zdd <0B>Z dd <0C>Zd <0A>Zy)<11>
Serializera<EFBFBD>This class provides a serialization interface on top of the
signer. It provides a similar API to json/pickle and other modules but is
slightly differently structured internally. If you want to change the
underlying implementation for parsing and loading you have to override the
:meth:`load_payload` and :meth:`dump_payload` functions.
This implementation uses simplejson if available for dumping and loading
and will fall back to the standard library's json module if it's not
available.
Starting with 0.14 you do not need to subclass this class in order to
switch out or customer the :class:`Signer`. You can instead also pass a
different class to the constructor as well as keyword arguments as
dictionary that should be forwarded::
s = Serializer(signer_kwargs={'key_derivation': 'hmac'})
.. versionchanged:: 0.14:
The `signer` and `signer_kwargs` parameters were added to the
constructor.
Nc<00><><00>t|<01>|_t|<02>|_|<03> |j}||_t |<03>|_|<04> |j }||_|xsi|_yr ) r'r<>r<><00>default_serializerr*r+<00>default_signer<65>signer<65> signer_kwargs)rr<>r<>r*r<>r<>s rr=zSerializer.__init__sc<00><00>$<24>Z<EFBFBD>0<><04><0F><1E>t<EFBFBD>$<24><04> <09> <15> <1D><1D>0<>0<>J<EFBFBD>$<24><04><0F>"4<>Z<EFBFBD>"@<40><04><1F> <11>><3E><19>(<28>(<28>F<EFBFBD><1C><04> <0B>*<2A>0<>b<EFBFBD><04>rc<00><><00>|<02>|j}|j}n t|<02>} |r|jd<02>}|j|<01>S#t$r}t d|<04><04><00>d}~wwxYw)aLoads the encoded object. This function raises :class:`BadPayload`
if the payload is not valid. The `serializer` parameter can be used to
override the serializer stored on the class. The encoded payload is
always byte based.
NrCzRCould not load the payload because an exception occurred on unserializing the data<74>rI)r*r+<00>decoderr<rG)rrr*<00>is_textr<74>s r<00> load_payloadzSerializer.load_payload st<00><00> <16> <1D><1D><1F><1F>J<EFBFBD><1A>-<2D>-<2D>G<EFBFBD>(<28><1A>4<>G<EFBFBD> "<22><16>!<21>.<2E>.<2E><17>1<><07><1D>#<23>#<23>G<EFBFBD>,<2C> ,<2C><><18> "<22><1C>?<3F> <20>"<22> "<22><> "<22>s<00>#A <00> A'<03> A"<03>"A'c<00>J<00>t|jj|<01><00>S)z<>Dumps the encoded object. The return value is always a
bytestring. If the internal serializer is text based the value
will automatically be encoded to utf-8.
)r'r*rrs r<00> dump_payloadzSerializer.dump_payload!s<00><00>
<1A>$<24>/<2F>/<2F>/<2F>/<2F><03>4<>5<>5rc<00>p<00>|<01> |j}|j|jfd|i|j<00><01>S)z<>A method that creates a new instance of the signer to be used.
The default implementation uses the :class:`Signer` baseclass.
r<>)r<>r<>r<>r<>)rr<>s r<00> make_signerzSerializer.make_signer(s7<00><00> <10><<3C><17>9<EFBFBD>9<EFBFBD>D<EFBFBD><1A>t<EFBFBD>{<7B>{<7B>4<EFBFBD>?<3F>?<3F>L<><14>L<><14>9K<39>9K<39>L<>Lrc<00><><00>t|j|<01><00>}|j|<02>j|<03>}|jr|j d<01>}|S)z<>Returns a signed string serialized with the internal serializer.
The return value can be either a byte or unicode string depending
on the format of the internal serializer.
rC)r'r<>r<>r<>r+r<>)rrr<>rros rrzSerializer.dumps0sP<00><00>
<1D>T<EFBFBD>.<2E>.<2E>s<EFBFBD>3<>4<><07> <11> <1D> <1D>d<EFBFBD> #<23> (<28> (<28><17> 1<><02> <0F> "<22> "<22><13><19><19>7<EFBFBD>#<23>B<EFBFBD><11> rc<00>F<00>|j|j||<03><00>y)z<>Like :meth:`dumps` but dumps into a file. The file handle has
to be compatible with what the internal serializer expects.
N)<02>writer)rr<00>fr<66>s r<00>dumpzSerializer.dump;s<00><00>
<EFBFBD><07><07><04>
<EFBFBD>
<EFBFBD>3<EFBFBD><04>%<25>&rc<00>v<00>t|<01>}|j|j|<02>j|<01><00>S)zhReverse of :meth:`dumps`, raises :exc:`BadSignature` if the
signature validation fails.
)r'r<>r<>r<><00>rr$r<>s rrzSerializer.loadsAs4<00><00> <17>q<EFBFBD>M<EFBFBD><01><13> <20> <20><14>!1<>!1<>$<24>!7<>!><3E>!><3E>q<EFBFBD>!A<>B<>Brc<00>B<00>|j|j<00>|<02>S)z)Like :meth:`loads` but loads from a file.)r<00>read)rr<>r<>s r<00>loadzSerializer.loadHs<00><00><13>z<EFBFBD>z<EFBFBD>!<21>&<26>&<26>(<28>D<EFBFBD>)<29>)rc<00>&<00>|j||<02>S)aELike :meth:`loads` but without verifying the signature. This is
potentially very dangerous to use depending on how your serializer
works. The return value is ``(signature_okay, payload)`` instead of
just the payload. The first item will be a boolean that indicates
if the signature is okay (``True``) or if it failed. This function
never fails.
Use it for debugging only and if you know that your serializer module
is not exploitable (eg: do not use it with a pickle serializer).
.. versionadded:: 0.15
<20><01>_loads_unsafe_implr<6C>s r<00> loads_unsafezSerializer.loads_unsafeLs<00><00><14>&<26>&<26>q<EFBFBD>$<24>/<2F>/rc<00><><00> d|j|fd|i|xsi<00><01>fS#t$rR}|j<00>Yd}~y d|j|jfi|xsi<00><01>fcYd}~S#t$rYYd}~ywxYwd}~wwxYw)zeLowlevel helper function to implement :meth:`loads_unsafe` in
serializer subclasses.
Tr<54>N)FNF)rrLrr<>rG)rr$r<><00> load_kwargs<67>load_payload_kwargsr<73>s rr<>zSerializer._loads_unsafe_impl[s<><00><00>
#<23><17><1A><14><1A><1A>A<EFBFBD>H<>D<EFBFBD>H<>[<5B>5F<35>B<EFBFBD>H<>H<> H<><48><1B> #<23><10>y<EFBFBD>y<EFBFBD> <20>"<22> #<23><1C>/<2F>d<EFBFBD>/<2F>/<2F><01> <09> <09>3<>*<2A>0<>b<EFBFBD>3<>3<>3<><33><1D> #<23>"<22> #<23><>  #<23>s7<00><00> A8<03> A3<03>"A <02>A8<03> A0<05>)A3<03>/A0<05>0A3<03>3A8c<00>J<00>|j|j<00>g|<02><01>i|<03><01>S)zYLike :meth:`loads_unsafe` but loads from a file.
.. versionadded:: 0.15
)r<>r<>)rr<><00>args<67>kwargss r<00> load_unsafezSerializer.load_unsafeks'<00><00>
!<21>t<EFBFBD> <20> <20><11><16><16><18>;<3B>D<EFBFBD>;<3B>F<EFBFBD>;<3B>;r)s itsdangerousNNNr rR)rrrrrr<>r<>r<>r=r<>r<>r<>rr<>rr<>r<>r<>r<>rrrr<>r<><00>s]<00><00><08>0<1E><16> <1C>N<EFBFBD>DH<44>,0<> 1<>"<22>(6<>M<01> <12>'<27> C<01>*<2A> 0<>7;<3B>/3<>#<23> <rr<>c<00>$<00>eZdZdZeZdd<03>Zdd<04>Zy)<07>TimedSerializerzQUses the :class:`TimestampSigner` instead of the default
:meth:`Signer`.
Nc<00><><00>|j|<04>j||d<01><02>\}}|j|<05>}|r||fS|S)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
which is a subclass of :exc:`BadSignature`. All arguments are
forwarded to the signer's :meth:`~TimestampSigner.unsign` method.
T)r<>)r<>r<>r<>)rr$r<>r<>r<><00>base64dr<64>rs rrzTimedSerializer.loadszsN<00><00>"<22>-<2D>-<2D>d<EFBFBD>3<> <13>V<EFBFBD>A<EFBFBD>w<EFBFBD><14>V<EFBFBD> 6<> <1B><07><19><16>#<23>#<23>G<EFBFBD>,<2C><07> <1B><1A>I<EFBFBD>%<25> %<25><16>rc<00>6<00>d|i}i}|j||||<05>S)Nr<4E>r<>)rr$r<>r<>r<>r<>s rr<>zTimedSerializer.loads_unsafe<66>s*<00><00> <20>'<27>*<2A> <0B> <20><1B><13>&<26>&<26>q<EFBFBD>$<24> <0B>=P<>Q<>Qr)NFNrR)rrrrr<>r<>rr<>rrrr<>r<>ss<00><00><08>%<25>N<EFBFBD> <17>Rrr<>c<00><><00>eZdZdZeej <00>eej<00>eej<00>e <09>d<02>Z
dZ e Z dd<05>Zdd<06>Zd<07>Zd<08>Zdd <09>Zd
<EFBFBD>Zdd <0B>Zdd <0C>Zdd <0A>Zy)<12>JSONWebSignatureSerializerzsThis serializer implements JSON Web Signature (JWS) support. Only
supports the JWS Compact Serialization.
)<04>HS256<35>HS384<38>HS512r<32>r<>Nc<00><><00>tj||||||<05>|<06> |j}||_|j |<06>|_yr )r<>r=<00>default_algorithm<68>algorithm_name<6D>make_algorithmr<6D>)rr<>r<>r*r<>r<>r<>s rr=z#JSONWebSignatureSerializer.__init__<5F>sH<00><00><12><1B><1B>D<EFBFBD>*<2A>d<EFBFBD>J<EFBFBD>"<22>M<EFBFBD> 3<> <19> !<21>!<21>3<>3<>N<EFBFBD>,<2C><04><1B><1D>,<2C>,<2C>^<5E><<3C><04>rc<00><><00>t|<01>}d|vr td<02><00>|jdd<03>\}} t|<03>} t|<04>} t j||t<00><07>}t|t<00>s t d |<08>
<EFBFBD><00>t j||<07>}|r||fS|S#t$r}t d|<06><05><00>d}~wwxYw#t$r}td|<06><05><00>d}~wwxYw#t$r}t d|<06><05><00>d}~wwxYw) N<>.zNo "." found in valuerz:Could not base64 decode the header because of an exceptionr<6E><00>;Could not base64 decode the payload because of an exceptionr)z5Could not unserialize header because it was malformedz#Header payload is not a JSON object)rV) r'rG<00>splitrfr<rTr<>r<>rr:r!<00>dict) rr<00> return_header<65>base64d_header<65>base64d_payload<61> json_headerr<72><00> json_payloadrVs rr<>z'JSONWebSignatureSerializer.load_payload<61>s*<00><00><1C>W<EFBFBD>%<25><07> <0F>w<EFBFBD> <1E><1C>4<>5<> 5<>*1<>-<2D>-<2D><04>a<EFBFBD>*@<40>'<27><0E><0F> 2<>'<27><0E>7<>K<EFBFBD> 2<>(<28><1F>9<>L<EFBFBD> /<2F><1F>,<2C>,<2C>T<EFBFBD>;<3B><1F>-<2D>!<21>F<EFBFBD>
<1A>&<26>$<24>'<27><1B>A<><1D><1F> <1F><1C>)<29>)<29>$<24> <0C>=<3D><07> <18><1A>F<EFBFBD>?<3F> "<22><16><0E><>)<19> 2<><1B><1F>/0<>2<> 2<><32> 2<><32>
<19> 2<><1C><1F>/0<>2<> 2<><32> 2<><32> <17> /<2F><1B><1C>,-<2D>/<2F> /<2F><> /<2F>sF<00> B <00> B><00> C<00> B;<03>) B6<03>6B;<03>> C<03> C<03>C<03> C7<03>% C2<03>2C7c<00><><00>t|jj|<01><00>}t|jj|<02><00>}|dz|zS)Nr<4E>)r`r*r)rrVrrrs rr<>z'JSONWebSignatureSerializer.dump_payload<61>sD<00><00>&<26>t<EFBFBD><EFBFBD><EFBFBD>'<<3C>'<<3C>V<EFBFBD>'D<>E<><0E>'<27><04><0F><0F>(=<3D>(=<3D>c<EFBFBD>(B<>C<><0F><1D><04>$<24><EFBFBD>6<>6rc<00>R<00> |j|S#t$r td<01><00>wxYw)NzAlgorithm not supported)<03>jws_algorithms<6D>KeyErrorr{)rr<>s rr<>z)JSONWebSignatureSerializer.make_algorithm<68>s6<00><00> A<01><17>&<26>&<26>~<7E>6<> 6<><36><17> A<01>%<25>&?<3F>@<40> @<40> A<01>s<00><00>&c<00><><00>|<01> |j}|<01>dnd}|<02> |j}|j|j|d||<02><03>S)Nr<4E>r<>)r<>r<>r<>r<>)r<>r<>r<>r<>)rr<>r<>r<>s rr<>z&JSONWebSignatureSerializer.make_signer<65>sQ<00><00> <0F><<3C><17>9<EFBFBD>9<EFBFBD>D<EFBFBD>#'<27><<3C><16>T<EFBFBD><0E> <14> <1C><1C><0E><0E>I<EFBFBD><13>{<7B>{<7B>4<EFBFBD>?<3F>?<3F><14>3<EFBFBD>)<29>Y<EFBFBD><1B>@<01> @rc<00>L<00>|r|j<00>ni}|j|d<|S)N<>alg)<02>copyr<79>)r<00> header_fieldsrVs r<00> make_headerz&JSONWebSignatureSerializer.make_header<65>s(<00><00>)6<><1D>#<23>#<23>%<25>B<EFBFBD><06><1C>+<2B>+<2B><06>u<EFBFBD> <0A><15> rc<00><><00>|j|<03>}|j||j<00>}|j|j ||<01><00>S)z<>Like :meth:`~Serializer.dumps` but creates a JSON Web Signature. It
also allows for specifying additional fields to be included in the JWS
Header.
)rr<>r<>r<>r<>)rrr<>rrVr<>s rrz JSONWebSignatureSerializer.dumps<70>sF<00><00>
<16>!<21>!<21>-<2D>0<><06><15>!<21>!<21>$<24><04><0E><0E>7<><06><15>{<7B>{<7B>4<EFBFBD>,<2C>,<2C>V<EFBFBD>S<EFBFBD>9<>:<3A>:rc<00><><00>|j|j||j<00>jt |<01><00>d<01><02>\}}|j d<03>|j k7rtd||<04><05><00>|r||fS|S)zyReverse of :meth:`dumps`. If requested via `return_header` it will
return a tuple of payload and header.
T<>rr zAlgorithm mismatch)rVr)r<>r<>r<>r<>r'<00>getr<74>rT<00>rr$r<>rrrVs rrz JSONWebSignatureSerializer.loads<64>s<><00><00><1F>+<2B>+<2B> <10> <1C> <1C>T<EFBFBD>4<EFBFBD>><3E>><3E> 2<> 9<> 9<>*<2A>Q<EFBFBD>-<2D> H<><1E>,<2C> <20><0F><07><16> <12>:<3A>:<3A>e<EFBFBD> <1C><04> 3<> 3<> 3<><1B>0<><16>$+<2B>-<2D> -<2D> <18><1A>F<EFBFBD>?<3F> "<22><16>rc<00>2<00>d|i}|j||||<04>S)Nrr<>)rr$r<>rr<>s rr<>z'JSONWebSignatureSerializer.loads_unsafe<66>s#<00><00>!<21>=<3D>1<><06><13>&<26>&<26>q<EFBFBD>$<24><06><06>?<3F>?r)NNNNN)FrRr<>)rrrrr<>r<><00>sha256<35>sha384<38>sha512r<32>rr<><00> compact_jsonr<6E>r=r<>r<>r<>r<>rrrr<>rrrr<>r<><00>s}<00><00><08>
<1F>w<EFBFBD>~<7E>~<7E>.<2E><1E>w<EFBFBD>~<7E>~<7E>.<2E><1E>w<EFBFBD>~<7E>~<7E>.<2E><1D><0F> <06>N<EFBFBD> <20><15>%<25><16>9=<3D>AE<41>=<3D><17>:7<>
A<01> @<01><16>
;<3B> <17>@rr<>c<00>6<00>eZdZdZdZd d<04>Zd<05>Zd
d<06>Zd<07>Zd<08>Z y) <0B>TimedJSONWebSignatureSerializerazWorks 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 possibility
extension like this in the spec. Expiry date is encoded into the header
similarily as specified in `draft-ietf-oauth-json-web-token
<http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#expDef`_.
The unsign method can raise a :exc:`SignatureExpired` method if the
unsigning failed because the signature is expired. This exception is a
subclass of :exc:`BadSignature`.
iNc <00>\<00>tj||fi|<03><01>|<02> |j}||_yr )r<>r=<00>DEFAULT_EXPIRES_IN<49>
expires_in)rr<>rr<>s rr=z(TimedJSONWebSignatureSerializer.__init__ s/<00><00>"<22>+<2B>+<2B>D<EFBFBD>*<2A>G<><06>G<> <15> <1D><1D>0<>0<>J<EFBFBD>$<24><04>rc<00><><00>tj||<01>}|j<00>}||jz}||d<||d<|S)N<>iat<61>exp)r<>r<00>nowr)rrrVr r!s rrz+TimedJSONWebSignatureSerializer.make_headersD<00><00>+<2B>7<>7<><04>m<EFBFBD>L<><06><12>h<EFBFBD>h<EFBFBD>j<EFBFBD><03><11>D<EFBFBD>O<EFBFBD>O<EFBFBD>#<23><03><1B><06>u<EFBFBD> <0A><1B><06>u<EFBFBD> <0A><15> rc<00>"<00>tj|||d<01><02>\}}d|vr td|<04><05><00>t|dt<00>r|ddkDs td|<04><05><00>|d|j <00>krt d||j|<05><00> <09><00>|r||fS|S)
NTrr!zMissing expiry dater<65>rzexpiry date is not an IntDatezSignature expiredr<64>)r<>rrLr!<00> number_typesr"rX<00>get_issue_daters rrz%TimedJSONWebSignatureSerializer.loadss<><00><00>4<>:<3A>:<3A> <10>!<21>T<EFBFBD><14>;<3B>/<2F><0F><07><16> <11><06> <1E><1E>4<>g<EFBFBD>F<> F<><1A>6<EFBFBD>%<25>=<3D>,<2C>7<><1A>5<EFBFBD>M<EFBFBD>A<EFBFBD>%<25><1E>><3E>'.<2E>0<> 0<> <12>%<25>=<3D>4<EFBFBD>8<EFBFBD>8<EFBFBD>:<3A> %<25>"<22>#6<><07>/3<>/B<>/B<>6<EFBFBD>/J<>L<01> L<01> <19><1A>F<EFBFBD>?<3F> "<22><16>rc<00><><00>|jd<01>}t|t<00>rtjt |<02><00>Sy)Nr )rr!r$rr<>r<>)rrVros rr%z.TimedJSONWebSignatureSerializer.get_issue_date-s4<00><00> <13>Z<EFBFBD>Z<EFBFBD><05> <1E><02> <15>b<EFBFBD>,<2C> '<27><1B>,<2C>,<2C>S<EFBFBD><12>W<EFBFBD>5<> 5<> (rc<00><<00>ttj<00><00>Sr )r<>r<>r@s rr"z#TimedJSONWebSignatureSerializer.now2s<00><00><12>4<EFBFBD>9<EFBFBD>9<EFBFBD>;<3B><1F>rr r<>)
rrrrrr=rrr%r"rrrrr<00>s(<00><00> <08><1E><16>%<25> <16><17>(6<>
 rrc<00>,<00><00>eZdZdZ<03>fd<02>Z<04>fd<03>Z<05>xZS)<04>URLSafeSerializerMixinz<6E>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.
c<00><00><01>d}|jd<02>r|dd}d} t|<01>}|r t j
|<03>}t t|<00>#|<03>S#t$r}td|<04><06><00>d}~wwxYw#t$r}td|<04><06><00>d}~wwxYw)NFr<46>rTr<54>r<>zACould not zlib decompress the payload before decoding the payload) <09>
startswithrfr<rG<00>zlib<69>
decompress<EFBFBD>superr)r<>)rrr-rr<><00> __class__s <20>rr<>z#URLSafeSerializerMixin.load_payload<s<><00><><00><1A>
<EFBFBD> <12> <1D> <1D>d<EFBFBD> #<23><1D>a<EFBFBD>b<EFBFBD>k<EFBFBD>G<EFBFBD><1D>J<EFBFBD> 2<> <20><17>)<29>D<EFBFBD> <16> ><3E><1B><EFBFBD><EFBFBD>t<EFBFBD>,<2C><04><15>+<2B>T<EFBFBD>?<3F><04>E<>E<><45><19> 2<><1C><1F>/0<>2<> 2<><32> 2<><32> <1D> ><3E> <20>"+<2B>;<<3C>><3E>><3E><> ><3E>s.<00> A<00>A1<00> A.<03> A)<03>)A.<03>1 B <03>: B<03>B c<00><><00><01>tt|<00> |<01>}d}tj|<02>}t |<04>t |<02>dz
kr|}d}t |<02>}|rd|z}|S)NFrTr<54>)r.r)r<>r,<00>compressr/r`)rrr<00> is_compressed<65>
compressedr<EFBFBD>r/s <20>rr<>z#URLSafeSerializerMixin.dump_payloadNsa<00><><00><14>+<2B>T<EFBFBD>?<3F><03>D<><04><1D> <0A><19>]<5D>]<5D>4<EFBFBD>(<28>
<EFBFBD> <0E>z<EFBFBD>?<3F>c<EFBFBD>$<24>i<EFBFBD>!<21>m<EFBFBD> ,<2C><1D>D<EFBFBD> <20>M<EFBFBD><1F><04>%<25><07> <18><1A>W<EFBFBD>n<EFBFBD>G<EFBFBD><16>r)rrrrr<>r<><00> __classcell__)r/s@rr)r)6s<00><><00><08>
F<01>$
<17>
rr)c<00><00>eZdZdZeZy)<03>URLSafeSerializerz<72>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<>rrrrrr<>rrrr6r6[<00><00><00><08>&<26>rr6c<00><00>eZdZdZeZy)<03>URLSafeTimedSerializerz<72>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 ``'.'``.
Nr7rrrr:r:cr8rr:)rC<00>strict)=r<00>sysr<73>r,r<>r[r<><00>operatorr<00> version_inforE<00> itertoolsr<00>unicoder"<00>chrrkr<><00>long<6E>floatr$<00> functoolsr<00>zip<69>str<74> methodcaller<65>
simplejsonr<00> ImportError<6F>objectr rr<>r'r+<00>getattrr.r8r<r:rGrLrOrTrXr`rfrprwryr<>r<>r<>r<>r<>r<>r<>rr)r6r:rrr<00><module>rLs<><00><01> <04> <0B> <0B> <0B> <0B> <0A><0E><0F><1D>
<EFBFBD><16><16>q<EFBFBD><19>Q<EFBFBD><1E><03><06><1E><17>I<EFBFBD><15>K<EFBFBD><17><14>u<EFBFBD>%<25>L<EFBFBD> <20> <0E>D<EFBFBD><13>I<EFBFBD>'<27>(<28>'<27>'<27>
<EFBFBD>A<EFBFBD>u<EFBFBD>=<3D>K<EFBFBD><17><15><<3C>L<EFBFBD><10><1D>
6<>6<EFBFBD>6<><1C>~<7E> <0C> <13><05> <0A> 7<>")<29><14>/?<3F><14>!F<><1E><17>.6<>i<EFBFBD>6<>*-<2D><17>-<2D>( <1F>7<EFBFBD> <1F> '<27>|<7C> '<27> -<2D> <0C>-<2D>*<08>'<27><08>8<>H<01>"<22>B<01> J<01>v<EFBFBD> J<01><13>$<24><13><1C>$<24><1C>"o<19>V<EFBFBD>o<19>dZ<19>f<EFBFBD>Z<19>zQ<<3C><16>Q<<3C>hR<01>j<EFBFBD>R<01>8i@<01><1A>i@<01>X8 <20>&@<40>8 <20>v"<17>V<EFBFBD>"<17>J&<26>.<2E>
<EFBFBD>&<26>&<26>3<>_<EFBFBD>&<26><>y<13><10><0F><10>s<00>,E-<00>- E:<03>9E: