|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /proc/self/root/lib/python2.7/site-packages/itsdangerous/ |
Upload File : |
�
-/�_c @ s� d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m
Z
d e f d
� � YZ d e f d � � YZ
d
e f d � � YZ d e f d � � YZ d S( i����Ni ( t constant_time_compare( t _base64_alphabet( t
base64_decode( t
base64_encode( t
want_bytes( t BadSignaturet SigningAlgorithmc B s e Z d Z d � Z d � Z RS( sg Subclasses must implement :meth:`get_signature` to provide
signature generation functionality.
c C s
t � � d S( s2 Returns the signature for the given key and value.N( t NotImplementedError( t selft keyt value( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyt
get_signature s c C s t | | j | | � � S( sM Verifies the given signature matches the expected
signature.
( R R ( R R R
t sig( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyt verify_signature s ( t __name__t
__module__t __doc__R R
( ( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR s t
NoneAlgorithmc B s e Z d Z d � Z RS( s` Provides an algorithm that does not perform any signing and
returns an empty signature.
c C s d S( Nt ( ( R R R
( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR ! s ( R R R R ( ( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR s t
HMACAlgorithmc B s2 e Z d Z e e j � Z d d � Z d � Z RS( s* Provides signature generation using HMACs.c C s% | d k r | j } n | | _ d S( N( t Nonet default_digest_methodt
digest_method( R R ( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyt __init__- s c C s( t j | d | d | j �} | j � S( Nt msgt digestmod( t hmact newR t digest( R R R
t mac( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR 2 s N(
R R R t staticmethodt hashlibt sha1R R R R ( ( ( s; /tmp/pip-install-sTXtzD/itsdangerous/itsdangerous/signer.pyR % s t Signerc B sq e Z d Z e e j � Z d Z d
d d
d
d
d � Z d � Z
d � Z d � Z d � Z
d � Z d � Z RS( s� This class can sign and unsign bytes, validating 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.
s
django-concatt .c C s� t | � | _ t | � | _ | j t k r<