
    Ǆg                        d dl mZ d dlZd dlmZ  G d de      Z G d de      Z G d d	e      Z G d
 de      Z	 G d de      Z
 G d de      Zy)    )annotationsN)datetimec                  ,     e Zd ZdZd fdZddZ xZS )BadDatazRaised if bad data of any sort was encountered. This is the base
    for all exceptions that ItsDangerous defines.

    .. versionadded:: 0.15
    c                2    t         |   |       || _        y N)super__init__message)selfr   	__class__s     X/home/mcse/projects/flask_80/flask-venv/lib/python3.12/site-packages/itsdangerous/exc.pyr
   zBadData.__init__   s    !    c                    | j                   S r   )r   )r   s    r   __str__zBadData.__str__   s    ||r   )r   str)returnr   )__name__
__module____qualname____doc__r
   r   __classcell__r   s   @r   r   r      s    r   r   c                  &     e Zd ZdZdd fdZ xZS )BadSignaturez%Raised if a signature does not match.c                2    t         |   |       || _        y r   )r	   r
   payload)r   r   r   r   s      r   r
   zBadSignature.__init__   s    ! &-r   r   )r   r   r   t.Any | Noner   r   r   r   r
   r   r   s   @r   r   r      s    /- -r   r   c                  4     e Zd ZdZ	 	 d	 	 	 	 	 d fdZ xZS )BadTimeSignaturezbRaised if a time-based signature is invalid. This is a subclass
    of :class:`BadSignature`.
    c                4    t         |   ||       || _        y r   )r	   r
   date_signed)r   r   r   r#   r   s       r   r
   zBadTimeSignature.__init__)   s     	'* 'r   )NN)r   r   r   r   r#   zdatetime | Noner   r   s   @r   r!   r!   $   s6     !%'+	'' ' %	' 'r   r!   c                      e Zd ZdZy)SignatureExpiredzrRaised if a signature timestamp is older than ``max_age``. This
    is a subclass of :exc:`BadTimeSignature`.
    N)r   r   r   r    r   r   r%   r%   <   s    r   r%   c                  :     e Zd ZdZ	 	 	 d	 	 	 	 	 	 	 d fdZ xZS )	BadHeaderzRaised 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
    c                B    t         |   ||       || _        || _        y r   )r	   r
   headeroriginal_error)r   r   r   r*   r+   r   s        r   r
   zBadHeader.__init__J   s'     	'* %+ 1?r   )NNN)r   r   r   r   r*   r   r+   Exception | Noner   r   s   @r   r(   r(   B   sC     !%#+/?? ? 	?
 )? ?r   r(   c                  &     e Zd ZdZdd fdZ xZS )
BadPayloada4  Raised if a payload is invalid. This could happen if the payload
    is loaded despite an invalid signature, or if there is a mismatch
    between the serializer and deserializer. The original exception
    that occurred during loading is stored on as :attr:`original_error`.

    .. versionadded:: 0.15
    c                2    t         |   |       || _        y r   )r	   r
   r+   )r   r   r+   r   s      r   r
   zBadPayload.__init__e   s    ! 1?r   r   )r   r   r+   r,   r   r   s   @r   r.   r.   \   s    ? ?r   r.   )
__future__r   typingtr   	Exceptionr   r   r!   r%   r(   r.   r&   r   r   <module>r4      sW    "  i -7 -'| '0' ? ?4? ?r   