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

92 lines
11 KiB
Plaintext
Raw Normal View History

<EFBFBD>
<0C>Hi<48>%<00><01><><00>ddlmZddlmZddlZddlZddlZddl m
Z
ddl m Z ddl m Z ddl m Z ddlmZGd <09>d
<EFBFBD>ZGd <0B>d e<10>Zddd <0A>ZGd<0E>de<10>Z dd<10>ZGd<11>d<12>Zy)<16>)<01> annotationsN<73>)<01>_base64_alphabet)<01> base64_decode)<01> base64_encode)<01>
want_bytes)<01> BadSignaturec<01> <00>eZdZdZdd<02>Zdd<03>Zy)<07>SigningAlgorithmzgSubclasses must implement :meth:`get_signature` to provide
signature generation functionality.
c<01><00>t<00><00>)z2Returns the signature for the given key and value.)<01>NotImplementedError<6F><03>self<6C>key<65>values <20>U/home/intlc/projects/proxmox/venv/lib/python3.12/site-packages/itsdangerous/signer.py<70> get_signaturezSigningAlgorithm.get_signatures <00><00>!<21>#<23>#<23>c<01>N<00>tj||j||<02><00>S)zMVerifies the given signature matches the expected
signature.
)<03>hmac<61>compare_digestr)rrr<00>sigs r<00>verify_signaturez!SigningAlgorithm.verify_signatures$<00><00><14>"<22>"<22>3<EFBFBD><04>(:<3A>(:<3A>3<EFBFBD><05>(F<>G<>GrN<>r<00>bytesrr<00>returnr)rrrrrrr<00>bool)<06>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr<00>rrr r s<00><00><08>$<24>Hrr c<01><00>eZdZdZdd<02>Zy)<05> NoneAlgorithmz`Provides an algorithm that does not perform any signing and
returns an empty signature.
c<01><00>y)Nrr"rs rrzNoneAlgorithm.get_signature$s<00><00>rNr)rrr r!rr"rrr$r$s <00><00><08>rr$c<01>,<00>tj|<00>S)z<>Don't access ``hashlib.sha1`` until runtime. FIPS builds may not include
SHA-1, in which case the import and use as a default would fail before the
developer can configure something else.
)<02>hashlib<69>sha1)<01>strings r<00>
_lazy_sha1r*(s<00><00>
<13><<3C><<3C><06> <1F>rc<01>><00>eZdZUdZee<05>Zded<ddd<05>Zd d<06>Z y)
<EFBFBD> HMACAlgorithmz*Provides signature generation using HMACs.<2E>t.Any<6E>default_digest_methodNc<01>.<00>|<01> |j}||_y<00>N)r.<00> digest_method)rr1s r<00>__init__zHMACAlgorithm.__init__8s<00><00> <18> <20> <20>6<>6<>M<EFBFBD>$1<><04>rc<01>f<00>tj|||j<00><01>}|j<00>S)N)<02>msg<73> digestmod)r<00>newr1<00>digest)rrr<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>rr0)r1r-r)
rrr r!<00> staticmethodr*r.<00>__annotations__r2rr"rrr,r,0s!<00><00>4<>
$0<>
<EFBFBD>#;<3B><19>5<EFBFBD>;<3B>2<> rr,c<01><><00>t|ttf<02>r t|<00>gS|D<00>cgc] }t|<01><00><02>c}Scc}wr0)<04>
isinstance<EFBFBD>strrr)<02>
secret_key<EFBFBD>ss r<00>_make_keys_listr@Cs8<00><00><12>*<2A>s<EFBFBD>E<EFBFBD>l<EFBFBD>+<2B><1A>:<3A>&<26>'<27>'<27>#-<2D> .<2E>a<EFBFBD>J<EFBFBD>q<EFBFBD>M<EFBFBD> .<2E>.<2E><> .s<00><c<01><><00>eZdZUdZee<05>Zded<dZded< d dd<08>Z e
dd <09><04>Z ddd
<EFBFBD>Z dd <0B>Z dd <0C>Zdd <0A>Zdd<0E>Zdd<0F>Zy)<19>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-r.<00> django-concatr=<00>default_key_derivationNc<01><<00>t|<01>|_t|<03>|_|jtvr t d<01><00>|<02> t|<02>}nd}||_|<04> |j}||_|<05> |j}||_
|<06>t|j<00>}||_ y)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.<2E>itsdangerous.Signer) r@<00> secret_keysr<00>sepr<00>
ValueError<EFBFBD>saltrD<00>key_derivationr.r1r,<00> algorithm)rr>rJrHrKr1rLs rr2zSigner.__init__<5F>s<><00><00>)8<>
<EFBFBD>(C<><04><18>$<24>S<EFBFBD>/<2F><04><08> <0F>8<EFBFBD>8<EFBFBD>'<27> '<27><1C>7<><0E> <0E> <10> <1B><1D>d<EFBFBD>#<23>D<EFBFBD>)<29>D<EFBFBD><18><04> <09> <19> !<21>!<21>8<>8<>N<EFBFBD>#1<><04><1B> <18> <20> <20>6<>6<>M<EFBFBD>$1<><04><1A> <14> <1C>%<25>d<EFBFBD>&8<>&8<>9<>I<EFBFBD>+4<><04>rc<01> <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>)rG)rs rr>zSigner.secret_key<65>s<00><00>
<14><1F><1F><02>#<23>#rc<01>|<00>|<01>|jd}n t|<01>}|jdk(rDtjt
|j |j|z<00>j<00><00>S|jdk(rGtjt
|j |jdz|z<00>j<00><00>S|jdk(rLtj||j <00><06>}|j|j<00>|j<00>S|jdk(r|Std<08><00>) a<>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.
rN<00>concatrCssignerr)r5<00>nonezUnknown key derivation method) rGrrK<00>t<>castrr1rJr7rr6<00>update<74> TypeError)rr>r8s r<00>
derive_keyzSigner.derive_key<65>s<00><00> <16> <1D><1D>)<29>)<29>"<22>-<2D>J<EFBFBD>#<23>J<EFBFBD>/<2F>J<EFBFBD> <0F> <1E> <1E>(<28> *<2A><14>6<EFBFBD>6<EFBFBD>%<25><14>!3<>!3<>D<EFBFBD>I<EFBFBD>I<EFBFBD>
<EFBFBD>4J<EFBFBD>!K<>!R<>!R<>!T<>U<> U<> <11> <20> <20>O<EFBFBD> 3<><14>6<EFBFBD>6<EFBFBD><15>t<EFBFBD>)<29>)<29>$<24>)<29>)<29>i<EFBFBD>*?<3F>*<2A>*L<>M<>T<>T<>V<><0E> <0E><12> <20> <20>F<EFBFBD> *<2A><16>(<28>(<28>:<3A><14>1C<31>1C<31>D<>C<EFBFBD> <0F>J<EFBFBD>J<EFBFBD>t<EFBFBD>y<EFBFBD>y<EFBFBD> !<21><16>:<3A>:<3A><<3C> <1F> <11> <20> <20>F<EFBFBD> *<2A><1D> <1D><1B>;<3B><<3C> <rc<01><><00>t|<01>}|j<00>}|jj||<01>}t |<03>S)z*Returns the signature for the given value.)rrVrLrr)rrrrs rrzSigner.get_signature<72>s9<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<01>Z<00>t|<01>}||jz|j|<01>zS)zSigns the given string.)rrHr)rrs r<00>signz Signer.sign<67>s+<00><00><1A>5<EFBFBD>!<21><05><14>t<EFBFBD>x<EFBFBD>x<EFBFBD><1F>$<24>"4<>"4<>U<EFBFBD>";<3B>;<3B>;rc<01><><00> t|<02>}t|<01>}t|j<00>D]2}|j |<03>}|j j|||<02>s<01>2yy#t$rYywxYw)z+Verifies the signature for the given value.FT)r<00> Exceptionr<00>reversedrGrVrLr)rrrr>rs rrzSigner.verify_signature<72>sw<00><00> <19><1F><03>$<24>C<EFBFBD><1B>5<EFBFBD>!<21><05>"<22>4<EFBFBD>#3<>#3<>4<> <1C>J<EFBFBD><16>/<2F>/<2F>*<2A>-<2D>C<EFBFBD><13>~<7E>~<7E>.<2E>.<2E>s<EFBFBD>E<EFBFBD>3<EFBFBD>?<3F><1B>  <1C> <15><><19> <19><18> <19>s<00> A#<00># A/<03>.A/c<01><><00>t|<01>}|j|vrtd|j<00>d<02><03><00>|j|jd<03>\}}|j ||<03>r|Std|<03>d<05>|<02><06><00>)zUnsigns the given string.zNo z found in valuerz
Signature z does not match)<01>payload)rrHr <00>rsplitr)r<00> signed_valuerrs r<00>unsignz Signer.unsign<67>su<00><00>!<21>,<2C>/<2F> <0C> <0F>8<EFBFBD>8<EFBFBD><<3C> '<27><1E><13>T<EFBFBD>X<EFBFBD>X<EFBFBD>L<EFBFBD><0F>@<40>A<> A<>!<21>(<28>(<28><14><18><18>1<EFBFBD>5<>
<EFBFBD><05>s<EFBFBD> <0F> <20> <20><15><03> ,<2C><18>L<EFBFBD><1A>Z<EFBFBD><03>w<EFBFBD>o<EFBFBD>><3E><05>N<>Nrc<01>F<00> |j|<01>y#t$rYywxYw)znOnly validates the given signed value. Returns ``True`` if
the signature exists and is valid.
TF)rar )rr`s r<00>validatezSigner.validates(<00><00> <19> <10>K<EFBFBD>K<EFBFBD> <0C> %<25><17><><1B> <19><18> <19>s <00><00> <03> )rF<00>.NNN) r><00>7str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes]rJ<00>str | bytes | NonerH<00> str | bytesrKz
str | Noner1z t.Any | NonerLzSigningAlgorithm | None)rrr0)r>rfrr)rrgrr)rrgrrgrr)r`rgrr)r`rgrr)rrr r!r9r*r.r:rDr2<00>propertyr>rVrrYrrarcr"rrrBrBLs<><00><00>#<08>V$0<>
<EFBFBD>#;<3B><19>5<EFBFBD>;<3B>#2<><1A>C<EFBFBD>1<>
$:<3A><1F>%)<29>&*<2A>-1<>,5<>K<>,5<>!<21>,5<><19> ,5<>
#<23> ,5<> $<24> ,5<>+<2B>,5<>\<0E>$<24><0E>$<24> =<3D>B"<22><<3C>
<15>" O<01>rrB)r)r)rrr-)r>rerz list[bytes])<16>
__future__r<00>collections.abc<62>abc<62>cabcr'r<00>typingrR<00>encodingrrrr<00>excr r r$r*r,r@rBr"rr<00><module>rpso<00><01>"<22><1E><0E> <0B><12>&<26>#<23>#<23> <20><1D> H<01> H<01> <13>$<24><13> <20><1C>$<24><1C>&/<2F>G<>/<2F><10>/<2F>~<19>~r