Files
wg-backend-django/dell-env/lib/python3.11/site-packages/itsdangerous/__pycache__/signer.cpython-311.pyc

89 lines
12 KiB
Plaintext
Raw Normal View History

2023-10-30 14:40:43 +07:00
<EFBFBD>
v]?e<>$<00><00>X<00>ddlZddlZddlZddlmZddlmZddlmZddlmZddl m
Z
ej e e fZejeZej ejeefZGd<08>d <09><00>ZGd
<EFBFBD>d e<13><00>ZGd <0C>d e<13><00>Zdedeje fd<10>ZGd<11>d<12><00>ZdS)<13>N<>)<01>_base64_alphabet)<01> base64_decode)<01> base64_encode<64><01>
want_bytes)<01> BadSignaturec<00>><00>eZdZdZdededefd<05>Zdedededefd<07>ZdS) <09>SigningAlgorithmzgSubclasses must implement :meth:`get_signature` to provide
signature generation functionality.
<20>key<65>value<75>returnc<00><00>t<00><00><00>)z2Returns the signature for the given key and value.)<01>NotImplementedError<6F><03>selfr r s <20>l/home/infidel/Sync/TIP/WireGuard/ocp-wg-backend/dell-env/lib/python3.11/site-packages/itsdangerous/signer.py<70> get_signaturezSigningAlgorithm.get_signatures<00><00>!<21>#<23>#<23>#<23><00>sigc<00>T<00>tj||<00>||<02><00><00><00>S)zMVerifies the given signature matches the expected
signature.
)<03>hmac<61>compare_digestr)rr r rs r<00>verify_signaturez!SigningAlgorithm.verify_signatures'<00><00><14>"<22>3<EFBFBD><04>(:<3A>(:<3A>3<EFBFBD><05>(F<>(F<>G<>G<>GrN)<08>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>bytesr<00>boolr<00>rrr r s<><00><00><00><00><00><00><08><08>$<24><15>$<24>u<EFBFBD>$<24><15>$<24>$<24>$<24>$<24>H<01>E<EFBFBD>H<01>%<25>H<01>e<EFBFBD>H<01><04>H<01>H<01>H<01>H<01>H<01>Hrr c<00>&<00>eZdZdZdededefd<05>ZdS)<07> NoneAlgorithmz`Provides an algorithm that does not perform any signing and
returns an empty signature.
r r rc<00><00>dS)Nrr!rs rrzNoneAlgorithm.get_signature%s<00><00><12>srN)rrrrrrr!rrr#r# sG<00><00><00><00><00><00><08><08><13><15><13>u<EFBFBD><13><15><13><13><13><13><13>rr#c<00>t<00>eZdZUdZeej<00><00>Zej e
d<d
dej fd<05>Z de de de fd <09>Z dS) <0B> HMACAlgorithmz*Provides signature generation using HMACs.<2E>default_digest_methodN<64> digest_methodc<00>&<00>|<01>|j}||_dS<00>N)r'r()rr(s r<00>__init__zHMACAlgorithm.__init__1s<00><00> <18> <20> <20>6<>M<EFBFBD>%2<><04><1A><1A>rr r rc<00>b<00>tj|||j<00><01><00>}|<03><00><00>S)N)<02>msg<73> digestmod)r<00>newr(<00>digest)rr r <00>macs rrzHMACAlgorithm.get_signature7s)<00><00><12>h<EFBFBD>s<EFBFBD><05><14>1C<31>D<>D<>D<><03><12>z<EFBFBD>z<EFBFBD>|<7C>|<7C>rr*)rrrr<00> staticmethod<6F>hashlib<69>sha1r'<00>_t<5F>Any<6E>__annotations__r+rrr!rrr&r&)s<><00><00><00><00><00><00><00>4<>4<>
%1<>L<EFBFBD><17><1C>$><3E>$><3E><19>2<EFBFBD>6<EFBFBD>><3E>><3E>><3E>3<>3<>b<EFBFBD>f<EFBFBD>3<>3<>3<>3<> <1C><15><1C>u<EFBFBD><1C><15><1C><1C><1C><1C><1C>rr&<00>
secret_keyrc<00>r<00>t|ttf<02><00>rt|<00><00>gSd<01>|D<00><00>S)Nc<00>,<00>g|]}t|<01><00><00><02>Sr!r)<02>.0<EFBFBD>ss r<00>
<listcomp>z#_make_keys_list.<locals>.<listcomp>@s<00><00> .<2E> .<2E> .<2E>a<EFBFBD>J<EFBFBD>q<EFBFBD>M<EFBFBD>M<EFBFBD> .<2E> .<2E> .r)<04>
isinstance<EFBFBD>strrr)r8s r<00>_make_keys_listr@<s=<00><00><11>*<2A>s<EFBFBD>E<EFBFBD>l<EFBFBD>+<2B>+<2B>(<28><1A>:<3A>&<26>&<26>'<27>'<27> .<2E> .<2E>:<3A> .<2E> .<2E> .<2E>.rc<00>P<00>eZdZUdZeej<00><00>Zej e
d<dZ e e
d< dde d ed
ed eje d ejej d ejef d<0E>Zedefd<10><04><00>Zddedefd<11>Zdedefd<13>Zdedefd<14>Zdededefd<16>Zdedefd<18>Zdedefd<19>ZdS)<1C>Signera<72>A signer securely signs bytes, then unsigns them to verify that
the value hasn't been changed.
The secret key should be a random string of ``bytes`` and should not
be saved to code or version control. Different salts should be used
to distinguish signing in different contexts. See :doc:`/concepts`
for information about the security of the secret key and salt.
:param secret_key: The secret key to sign and verify with. Can be a
list of keys, oldest to newest, to support key rotation.
:param salt: Extra key to combine with ``secret_key`` to distinguish
signatures in different contexts.
:param sep: Separator between the signature and value.
:param key_derivation: How to derive the signing key from the secret
key and salt. Possible values are ``concat``, ``django-concat``,
or ``hmac``. Defaults to :attr:`default_key_derivation`, which
defaults to ``django-concat``.
:param digest_method: Hash function to use when generating the HMAC
signature. Defaults to :attr:`default_digest_method`, which
defaults to :func:`hashlib.sha1`. Note that the security of the
hash alone doesn't apply when used intermediately in HMAC.
:param algorithm: A :class:`SigningAlgorithm` instance to use
instead of building a default :class:`HMACAlgorithm` with the
``digest_method``.
.. versionchanged:: 2.0
Added support for key rotation by passing a list to
``secret_key``.
.. versionchanged:: 0.18
``algorithm`` was added as an argument to the class constructor.
.. versionchanged:: 0.14
``key_derivation`` and ``digest_method`` were added as arguments
to the class constructor.
r'<00> django-concat<61>default_key_derivation<6F>itsdangerous.Signer<65>.Nr8<00>salt<6C>sep<65>key_derivationr(<00> algorithmc<00>@<00>t|<01><00>|_t|<03><00>|_|jtvrt d<01><00><00>|<02>t|<02><00>}nd}||_|<04>|j}||_|<05>|j }||_
|<06>t|j
<00><00>}||_ dS)Nz<4E>The given separator cannot be used because it may be contained in the signature itself. ASCII letters, digits, and '-_=' must not be used.rE) r@<00> secret_keysrrHr<00>
ValueErrorrGrDrIr'r(r&rJ)rr8rGrHrIr(rJs rr+zSigner.__init__xs<><00><00>,;<3B>:<3A>+F<>+F<><04><18>$<24>S<EFBFBD>/<2F>/<2F><04><08> <0F>8<EFBFBD>'<27> '<27> '<27><1C>7<><0E><0E> <0E> <10> <1B><1D>d<EFBFBD>#<23>#<23>D<EFBFBD>D<EFBFBD>)<29>D<EFBFBD><18><04> <09> <19> !<21>!<21>8<>N<EFBFBD>#1<><04><1B> <18> <20> <20>6<>M<EFBFBD>%2<><04><1A> <14> <1C>%<25>d<EFBFBD>&8<>9<>9<>I<EFBFBD>+4<><04><0E><0E>rrc<00><00>|jdS)z<>The newest (last) entry in the :attr:`secret_keys` list. This
is for compatibility from before key rotation support was added.
<20><><EFBFBD><EFBFBD><EFBFBD>)rL)rs rr8zSigner.secret_key<65>s<00><00>
<14><1F><02>#<23>#rc<00>n<00>|<01>|jd}nt|<01><00>}|jdkrGtjt
|<00>|j|z<00><00><00><00><00><00><00>S|jdkrJtjt
|<00>|jdz|z<00><00><00><00><00><00><00>S|jdkrItj
||j<00><07><00>}|<02> |j<00><00>|<02><00><00>S|jdkr|Std <09><00><00>)
a<EFBFBD>This method is called to derive the key. The default key
derivation choices can be overridden here. Key derivation 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.
:param secret_key: A specific secret key to derive from.
Defaults to the last item in :attr:`secret_keys`.
.. versionchanged:: 2.0
Added the ``secret_key`` parameter.
NrO<00>concatrCssignerr)r.<00>nonezUnknown key derivation method) rLrrIr5<00>castrr(rGr0rr/<00>update<74> TypeError)rr8r1s r<00>
derive_keyzSigner.derive_key<65>s <00><00> <16> <1D><1D>)<29>"<22>-<2D>J<EFBFBD>J<EFBFBD>#<23>J<EFBFBD>/<2F>/<2F>J<EFBFBD> <0F> <1E>(<28> *<2A> *<2A><15>7<EFBFBD>5<EFBFBD>$<24>"4<>"4<>T<EFBFBD>Y<EFBFBD><1A>5K<35>"L<>"L<>"S<>"S<>"U<>"U<>V<>V<> V<> <11> <20>O<EFBFBD> 3<> 3<><15>7<EFBFBD><15>t<EFBFBD>)<29>)<29>$<24>)<29>i<EFBFBD>*?<3F>*<2A>*L<>M<>M<>T<>T<>V<>V<><0E><0E> <0E><12> <20>F<EFBFBD> *<2A> *<2A><16>(<28>:<3A><14>1C<31>D<>D<>D<>C<EFBFBD> <0F>J<EFBFBD>J<EFBFBD>t<EFBFBD>y<EFBFBD> !<21> !<21> !<21><16>:<3A>:<3A><<3C><<3C> <1F> <11> <20>F<EFBFBD> *<2A> *<2A><1D> <1D><1B>;<3B><<3C><<3C> <rr c<00><><00>t|<01><00>}|<00><00><00>}|j<00>||<01><00>}t |<03><00>S)z*Returns the signature for the given value.)rrVrJrr)rr r rs rrzSigner.get_signature<72>sC<00><00><1A>5<EFBFBD>!<21>!<21><05><12>o<EFBFBD>o<EFBFBD><1F><1F><03><12>n<EFBFBD>*<2A>*<2A>3<EFBFBD><05>6<>6<><03><1C>S<EFBFBD>!<21>!<21>!rc<00>`<00>t|<01><00>}||jz|<00>|<01><00>zS)zSigns the given string.)rrHr)rr s r<00>signz Signer.sign<67>s/<00><00><1A>5<EFBFBD>!<21>!<21><05><14>t<EFBFBD>x<EFBFBD><1F>$<24>"4<>"4<>U<EFBFBD>";<3B>";<3B>;<3B>;rrc<00><><00> t|<02><00>}n#t$rYdSwxYwt|<01><00>}t|j<00><00>D]6}|<00>|<03><00>}|j<00>|||<02><00>rdS<00>7dS)z+Verifies the signature for the given value.FT)r<00> Exceptionr<00>reversedrLrVrJr)rr rr8r s rrzSigner.verify_signature<72>s<><00><00> <19><1F><03>$<24>$<24>C<EFBFBD>C<EFBFBD><43><18> <19> <19> <19><18>5<EFBFBD>5<EFBFBD> <19><><EFBFBD><EFBFBD><1B>5<EFBFBD>!<21>!<21><05>"<22>4<EFBFBD>#3<>4<>4<> <1C> <1C>J<EFBFBD><16>/<2F>/<2F>*<2A>-<2D>-<2D>C<EFBFBD><13>~<7E>.<2E>.<2E>s<EFBFBD>E<EFBFBD>3<EFBFBD>?<3F>?<3F> <1C><1B>t<EFBFBD>t<EFBFBD> <1C><15>us <00><00>
<03> <03> signed_valuec<00><><00>t|<01><00>}|j|vrtd|j<00>d<02><03><00><00>|<01>|jd<03><00>\}}|<00>||<03><00>r|Std|<03>d<05>|<02><06><00><00>)zUnsigns the given string.zNo z found in valuerz
Signature z does not match)<01>payload)rrHr <00>rsplitr)rr]r rs r<00>unsignz Signer.unsign<67>s<><00><00>!<21>,<2C>/<2F>/<2F> <0C> <0F>8<EFBFBD><<3C> '<27> '<27><1E>@<40>T<EFBFBD>X<EFBFBD>@<40>@<40>@<40>A<>A<> A<>!<21>(<28>(<28><14><18>1<EFBFBD>5<>5<>
<EFBFBD><05>s<EFBFBD> <0F> <20> <20><15><03> ,<2C> ,<2C> <19><18>L<EFBFBD><1A>><3E><03>><3E>><3E>><3E><05>N<>N<>N<>Nrc<00>T<00> |<00>|<01><00>dS#t$rYdSwxYw)znOnly validates the given signed value. Returns ``True`` if
the signature exists and is valid.
TF)rar )rr]s r<00>validatezSigner.validate<74>s@<00><00> <19> <10>K<EFBFBD>K<EFBFBD> <0C> %<25> %<25> %<25><17>4<EFBFBD><34><1B> <19> <19> <19><18>5<EFBFBD>5<EFBFBD> <19><><EFBFBD>s <00><00>
'<03>')rErFNNNr*)rrrrr2r3r4r'r5r6r7rDr?<00> _t_secret_key<65>_t_opt_str_bytes<65> _t_str_bytes<65>Optionalr r+<00>propertyrr8rVrrYr rrarcr!rrrBrBCs<><00><00><00><00><00><00><00>#<08>#<08>V%1<>L<EFBFBD><17><1C>$><3E>$><3E><19>2<EFBFBD>6<EFBFBD>><3E>><3E>><3E>#2<><1A>C<EFBFBD>1<>1<>1<>
"8<> <20>+/<2F>-1<>37<33>,5<>,5<>!<21>,5<><1F>,5<><1A> ,5<>
<1B> <0B>C<EFBFBD>(<28> ,5<> <1A>{<7B>2<EFBFBD>6<EFBFBD>*<2A> ,5<><16>;<3B>/<2F>0<>,5<>,5<>,5<>,5<>\<0E>$<24>E<EFBFBD>$<24>$<24>$<24><0E>X<EFBFBD>$<24> =<3D>=<3D>%5<>=<3D><15>=<3D>=<3D>=<3D>=<3D>B"<22><<3C>"<22>E<EFBFBD>"<22>"<22>"<22>"<22><<3C>,<2C><<3C>5<EFBFBD><<3C><<3C><<3C><<3C>
<15>l<EFBFBD><15><1C><15>$<24><15><15><15><15>" O<01><<3C> O<01>E<EFBFBD> O<01> O<01> O<01> O<01><19>\<5C><19>d<EFBFBD><19><19><19><19><19>rrB)r3r<00>typingr5<00>encodingrrrr<00>excr <00>Unionr?rrfrgre<00>Iterablerdr r#r&<00>Listr@rBr!rr<00><module>ros<><00><01><0E><0E><0E><0E> <0B> <0B> <0B> <0B><13><13><13><13>&<26>&<26>&<26>&<26>&<26>&<26>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23> <20> <20> <20> <20> <20> <20><1D><1D><1D><1D><1D><1D><11>x<EFBFBD><03>U<EFBFBD>
<EFBFBD>#<23> <0C><15>;<3B>|<7C>,<2C><10><12><08><12><1B>\<5C>2<>L<EFBFBD>@<40>A<> <0A> H<01> H<01> H<01> H<01> H<01> H<01> H<01> H<01> <13><13><13><13><13>$<24><13><13><13><1C><1C><1C><1C><1C>$<24><1C><1C><1C>&/<2F> <0A>/<2F>"<22>'<27>%<25>.<2E>/<2F>/<2F>/<2F>/<2F>~<19>~<19>~<19>~<19>~<19>~<19>~<19>~<19>~<19>~r