
    kKj~                         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 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 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 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 G d0 d1e      Z G d2 d3e      Z G d4 d5e      Z G d6 d7e      Z G d8 d9e      Z G d: d;e      Z G d< d=e      Z  G d> d?e      Z!eZ"y@)Ac                       e Zd ZdZy)SecurityWarningz+Base class for warnings of security issues.N)__name__
__module____qualname____doc__     _/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/joserfc/errors.pyr   r      s    5r	   r   c                   N     e Zd ZU dZdZeed<   dZeed<   ddedz  f fdZ xZ	S )	JoseErrorz)Base Exception for all errors in joserfc. errordescriptionNc                     ||| _         dj                  | j                  | j                         }t        t        |   |       y )Nz{}: {})r   formatr   superr   __init__)selfr   message	__class__s      r
   r   zJoseError.__init__   s:    "*D//$**d.>.>?i'0r	   N)
r   r   r   r   r   str__annotations__r   r   __classcell__r   s   @r
   r   r      s0    3 E3OK1C$J 1 1r	   r   c                       e Zd ZdZy)KeyParameterErrorkey_parameterNr   r   r   r   r   r	   r
   r   r      s    Er	   r   c                       e Zd ZdZy)MissingKeyErrormissing_keyNr   r   r	   r
   r!   r!      s    Er	   r!   c                       e Zd ZdZy)UnsupportedKeyUseErrorunsupported_key_useNr   r   r	   r
   r$   r$   "       !Er	   r$   c                       e Zd ZdZy)UnsupportedKeyAlgorithmErrorunsupported_key_algNr   r   r	   r
   r(   r(   &   r&   r	   r(   c                       e Zd ZdZy)UnsupportedKeyOperationErrorunsupported_key_operationNr   r   r	   r
   r+   r+   *   s    'Er	   r+   c                       e Zd ZdZy)MissingKeyTypeErrormissing_key_typeNr   r   r	   r
   r.   r.   .       Er	   r.   c                       e Zd ZdZy)InvalidKeyTypeErrorinvalid_key_typeNr   r   r	   r
   r2   r2   2   r0   r	   r2   c                       e Zd ZdZdZy)InvalidKeyIdErrorzgThis error is designed for Key Set. It is raised when a key
    can not be found with the given key ID.invalid_key_idNr   r   r   r   r   r   r	   r
   r5   r5   6   s    / Er	   r5   c                       e Zd ZdZdZdZy)InvalidExchangeKeyErrorz_This error is designed for EC and OKP keys. It is raised when
    exchanging derive key failed.invalid_exchange_keyz%Invalid key for exchanging shared keyNr   r   r   r   r   r   r   r	   r
   r9   r9   =   s    % #E9Kr	   r9   c                       e Zd ZdZdZy)DecodeErrorzmThis error is designed for both JWS and JWE. It is raised when deserialization
    and decryption fails.
    decode_errorNr7   r   r	   r
   r=   r=   H   s     Er	   r=   c                       e Zd ZdZdZdZy)MissingAlgorithmErrorz,Raised when an algorithm ("alg") is missing.missing_algorithmzMissing 'alg' value in headerNr;   r   r	   r
   r@   r@   P   s    6E1Kr	   r@   c                       e Zd ZdZy)ConflictAlgorithmErrorconflict_algorithmNr   r   r	   r
   rC   rC   W   s     Er	   rC   c                       e Zd ZdZdZy)UnsupportedAlgorithmErrorz}This error is designed for both JWS and JWE. It is raised when the
    given algorithm is not supported in the registry.
    unsupported_algorithmNr7   r   r	   r
   rF   rF   [   s     $Er	   rF   c                       e Zd ZdZdZy)InvalidHeaderValueErrorz0Raised when the given header's value is invalid.invalid_header_valueNr7   r   r	   r
   rI   rI   c   s
    :"Er	   rI   c                       e Zd ZdZdZy)UnsupportedHeaderErrorz1Raised when an unsupported header is encountered.unsupported_headerNr7   r   r	   r
   rL   rL   i   s
    ; Er	   rL   c                   ,     e Zd ZdZdZdef fdZ xZS )MissingHeaderErrorz;This error happens when the required header does not exist.missing_headerkeyc                 :    d| d}t         t        |   |       y )Nz	Missing '' value in headerr   )r   rO   r   r   rQ   r   r   s      r
   r   zMissingHeaderError.__init__t   s%    !#&78 $0[0Ir	   r   r   r   r   r   r   r   r   r   s   @r
   rO   rO   o   s    EEJC J Jr	   rO   c                   ,     e Zd ZdZdZdef fdZ xZS )MissingCritHeaderErrorz;This error happens when the critical header does not exist.missing_crit_headerrQ   c                 :    d| d}t         t        |   |       y )NzMissing critical 'rS   rT   )r   rX   r   rU   s      r
   r   zMissingCritHeaderError.__init__~   s%    *3%/@A$d44Mr	   rV   r   s   @r
   rX   rX   y   s    E!ENC N Nr	   rX   c                       e Zd ZdZdZdZy)MissingEncryptionErrorz[This error is designed for JWE. It is raised when the 'enc' value
    in header is missing.missing_encryptionzMissing 'enc' value in headerNr;   r   r	   r
   r\   r\      s     !E1Kr	   r\   c                       e Zd ZdZdZy)InvalidKeyCurveErrorztThis error is designed for JWS. It is raised when key's
    curve name does not match with the given algorithm.
    invalid_key_curveNr7   r   r	   r
   r_   r_      s      Er	   r_   c                       e Zd ZdZdZy)InvalidKeyLengthErrorzpThis error is designed for JWE. It is raised when key's
    length does not align with the given algorithm.
    invalid_key_lengthNr7   r   r	   r
   rb   rb      s     !Er	   rb   c                       e Zd ZdZdZy)BadSignatureErrorzTThis error is designed for JWS. It is raised when signature
    does not match.
    bad_signatureNr7   r   r	   r
   re   re      s     Er	   re   c                       e Zd ZdZdZy)ExceededSizeErrorzThis error is designed for validating the token's content size.
    It raised when the data exceeds the maximum allowed length.exceeded_sizeNr7   r   r	   r
   rh   rh      s    C Er	   rh   c                       e Zd ZdZdZy)InvalidEncryptionAlgorithmErrorzoThis error is designed for JWE. It is raised when "enc" value
    does not work together with "alg" value.
    invalid_encryption_algorithmNr7   r   r	   r
   rk   rk      s     +Er	   rk   c                       e Zd ZdZdZy)InvalidEncryptedKeyErrorinvalid_encrypted_keyz9JWE Encrypted Key value SHOULD be an empty octet sequenceN)r   r   r   r   r   r   r	   r
   rn   rn      s    #EMKr	   rn   c                   D     e Zd ZU dZeed<   dZddededz  f fdZ xZS )
ClaimErrorz,This a base error for JWT claims validation.claimzError claim: '{}'Nr   c                 v    || _         || j                  j                  |      }t        t        |   |       y )NrT   )rr   r   r   r   rq   r   )r   rr   r   r   s      r
   r   zClaimError.__init__   s8    
**11%8Kj$([(Ar	   r   )	r   r   r   r   r   r   r   r   r   r   s   @r
   rq   rq      s0    6J%KBc Bd
 B Br	   rq   c                       e Zd ZdZdZdZy)InvalidClaimErrorz^This error is designed for JWT. It raised when the claim contains
    invalid values or types.invalid_claimzInvalid claim: '{}'Nr;   r   r	   r
   ru   ru      s      E'Kr	   ru   c                       e Zd ZdZdZdZy)MissingClaimErrorzSThis error is designed for JWT. It raised when the required
    claims are missing.missing_claimzMissing claim: '{}'Nr;   r   r	   r
   rx   rx      s     E'Kr	   rx   c                       e Zd ZdZdZdZy)InsecureClaimErrorz\This error is designed for JWT. It raised when the claim
    contains sensitive information.insecure_claimzInsecure claim: '{}'Nr;   r   r	   r
   r{   r{      s    ' E(Kr	   r{   c                       e Zd ZdZdZdZy)ExpiredTokenErrorzDThis error is designed for JWT. It raised when the token is expired.expired_tokenzThe token is expiredNr;   r   r	   r
   r~   r~      s    NE(Kr	   r~   c                       e Zd ZdZdZy)InvalidPayloadErrorzZThis error is designed for JWT. It raised when the payload is
    not a valid JSON object.invalid_payloadNr7   r   r	   r
   r   r      s      Er	   r   N)#UserWarningr   	Exceptionr   r   r!   r$   r(   r+   r.   r2   r5   r9   r=   r@   rC   rF   rI   rL   rO   rX   r\   r_   rb   re   rh   rk   rn   rq   ru   rx   r{   r~   r   InvalidTokenErrorr   r	   r
   <module>r      s  	k 	1	 1&	 i ". ""#4 "(#4 (+ + 	 :i :) 2I 2!Y !$	 $#i #!Y !J JNY N2Y 2 9  !I !	 	 +i +Ny N
B 
B(
 ((
 () ))
 ))  & r	   