+
    Ii7                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	 ^RI
HtHtHtHt ^RIHt ^RIHtHtHtHtHt ^RIHtHt ^R	IHtHt ]'       d   ^R
I
HtHt ^RIHt ] ! 4       t! ! R R4      t"]"! 4       t#]#PH                  t$]#PJ                  t%]#PL                  t&]#PN                  t']#PP                  t(]#PR                  t)]#PT                  t*R# )    )annotationsN)Sequence)TYPE_CHECKINGAny)	Algorithmget_default_algorithms
has_cryptorequires_cryptography)PyJWK)DecodeErrorInvalidAlgorithmErrorInvalidKeyErrorInvalidSignatureErrorInvalidTokenError)base64url_decodebase64url_encode)InsecureKeyLengthWarningRemovedInPyjwt3Warning)AllowedPrivateKeysAllowedPublicKeys)
SigOptionsc                     ] tR t^!t$ RtR(R R llt]R R l4       tR R ltR	 R
 lt	R R lt
R R lt]RRRR3R R lltR)R R lltR)R R lltR R ltR R ltR*R R lltR0tR]R&   R R/R! R" lltR# R$ ltR% R& ltR'tR# )+PyJWSJWTNc               $    V ^8  d   QhRRRRRR/# )   
algorithmsSequence[str] | NoneoptionsSigOptions | NonereturnNone )formats   "tC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\jwt/api_jws.py__annotate__PyJWS.__annotate__$   s(     7 7(7 #7 
	7    c                	h   \        4       V n        Ve   \        V4      M\        V P                  4      V n        \	        V P                  P                  4       4       F"  pW0P                  9  g   K  V P                  V K$  	  V P                  4       V n        Ve   / V P                  CVCV n        R # R # )N)r   _algorithmsset_valid_algslistkeys_get_default_optionsr   )selfr   r   keys   &&& r%   __init__PyJWS.__init__$   s    
 23)5C
O3t?O?O;P 	
 ((--/0C***$$S) 1 $(#<#<#>6dll6g6DL r(   c                   V ^8  d   QhRR/# )r   r!   r   r#   )r$   s   "r%   r&   r'   8   s     O O* Or(   c                 	    R RRR/# )verify_signatureTenforce_minimum_key_lengthFr#   r#   r(   r%   r/   PyJWS._get_default_options7   s    "D*FNNr(   c               $    V ^8  d   QhRRRRRR/# )r   alg_idstralg_objr   r!   r"   r#   )r$   s   "r%   r&   r'   ;   s!     % % %y %T %r(   c                    WP                   9   d   \        R4      h\        V\        4      '       g   \	        R4      hW P                   V&   V P
                  P                  V4       R# )z
Registers a new Algorithm for use when creating and verifying tokens.

:param str alg_id: the ID of the Algorithm
:param alg_obj: the Algorithm object
:type alg_obj: Algorithm
z Algorithm already has a handler.z!Object is not of type `Algorithm`N)r*   
ValueError
isinstancer   	TypeErrorr,   add)r0   r:   r<   s   &&&r%   register_algorithmPyJWS.register_algorithm;   sW     %%%?@@'9--?@@#* V$r(   c                    V ^8  d   QhRRRR/# )r   r:   r;   r!   r"   r#   )r$   s   "r%   r&   r'   L   s     ( (3 (4 (r(   c                    WP                   9  d   \        R4      hV P                   V V P                  P                  V4       R# )z
Unregisters an Algorithm for use when creating and verifying tokens
:param str alg_id: the ID of the Algorithm
:raises KeyError: if algorithm is not registered.
zJThe specified algorithm could not be removed because it is not registered.N)r*   KeyErrorr,   remove)r0   r:   s   &&r%   unregister_algorithmPyJWS.unregister_algorithmL   sF     )))1 
 V$'r(   c                   V ^8  d   QhRR/# )r   r!   z	list[str]r#   )r$   s   "r%   r&   r'   [   s     & &	 &r(   c                ,    \        V P                  4      # )zP
Returns a list of supported values for the `alg` parameter.

:rtype: list[str]
)r-   r,   )r0   s   &r%   get_algorithmsPyJWS.get_algorithms[   s     D$$%%r(   c                    V ^8  d   QhRRRR/# )r   alg_namer;   r!   r   r#   )r$   s   "r%   r&   r'   c   s     H Hc Hi Hr(   c                     V P                   V,          #   \         d9   p\        '       g   T\        9   d   \	        RT R24      Th\	        R4      ThRp?ii ; i)z
For a given string name, return the matching Algorithm object.

Example usage:
>>> jws_obj = PyJWS()
>>> jws_obj.get_algorithm_by_name("RS256")

:param alg_name: The name of the algorithm to retrieve
:type alg_name: str
:rtype: Algorithm
zAlgorithm 'z9' could not be found. Do you have cryptography installed?Algorithm not supportedN)r*   rF   r	   r
   NotImplementedError)r0   rO   es   && r%   get_algorithm_by_namePyJWS.get_algorithm_by_namec   se    	H##H-- 	H:(.C"C)!(+de &&?@aG	Hs    A3AAFTc               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/# )r   payloadbytesr1   z(AllowedPrivateKeys | PyJWK | str | bytes	algorithmz
str | Noneheaderszdict[str, Any] | Nonejson_encoderztype[json.JSONEncoder] | Noneis_payload_detachedboolsort_headersr!   r;   r#   )r$   s   "r%   r&   r'   x   sd     X. X.X. 6X. 	X.
 'X. 4X. "X. X. 
X.r(   c                	   . pV\         J d'   \        V\        4      '       d   VP                  p	M/R p	M,Vf'   \        V\        4      '       d   VP                  p	MRp	MTp	V'       d<   VP	                  R4      p
V
'       d
   VR,          p	VP	                  R4      pVRJ d   RpRV P
                  RV	/pV'       d%   V P                  VRR7       VP                  V4       VR,          '       g   VR V'       d   RVR&   M
RV9   d   VR \        P                  ! VRWWR7      P                  4       pVP                  \        V4      4       V'       d   TpM\        V4      pVP                  V4       R	P                  V4      pV P                  V	4      p\        V\        4      '       d   VP                  pVP!                  V4      pVP#                  V4      pV'       dK   V P$                  P	                  R
R4      '       d   \'        V4      h\(        P*                  ! V\,        ^R7       VP/                  W4      pVP                  \        V4      4       V'       d   RV^&   R	P                  V4      pVP1                  R4      # )HS256nonealgb64FTtyp)encoding)
separatorscls	sort_keys   .r7   
stacklevelr(   utf-8),:)_ALGORITHM_UNSETr?   r   algorithm_nameget
header_typ_validate_headersupdatejsondumpsencodeappendr   joinrT   r1   prepare_keycheck_key_lengthr   r   warningswarnr   signdecode)r0   rW   r1   rY   rZ   r[   r\   r^   segments
algorithm_headers_algheaders_b64headerjson_headermsg_payloadsigning_inputr<   key_length_msg	signatureencoded_strings   &&&&&&&&            r%   rw   PyJWS.encodex   s     !# ((#u%% //
$
#u%% //
#
"J !++e,K$U^
!++e,Ke#&*# #(%!L""7T":MM'"e}}u!F5Mf_ujjz|

&( 	 	(56!K*73K$ 		(+,,Z8c5!!''C!!#& 11#6|| <eDD%n55n.FSTULL4	(34 HQK8,$$W--r(   c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r   jwtstr | bytesr1   'AllowedPublicKeys | PyJWK | str | bytesr   r   r   r    detached_payloadbytes | Nonekwargsdict[str, Any]r!   r#   )r$   s   "r%   r&   r'      sP     1
 1
1
 51
 )	1

 #1
 '1
 !1
 
1
r(   c                	h   V'       d8   \         P                  ! R \        VP                  4       4       2\        ^R7       Vf   V P
                  pM/ V P
                  CVCpVR,          pV'       d*   V'       g"   \        V\        4      '       g   \        R4      hV P                  V4      w  rrV P                  V4       VP                  RR4      RJ d<   Vf   \        R4      hTp	RP                  V
P                  R^4      ^ ,          V	.4      p
V'       d   V P                  WWV4       R	V	R
VRV/# )zypassing additional kwargs to decode_complete() is deprecated and will be removed in pyjwt version 3. Unsupported kwargs: rj   r6   z\It is required that you pass in a value for the "algorithms" argument when calling decode().rc   TFzIt is required that you pass in a value for the "detached_payload" argument to decode a message having the b64 header set to false.ri   rW   r   r   )r|   r}   tupler.   r   r   r?   r   r   _loadrs   rq   ry   rsplit_verify_signature)r0   r   r1   r   r   r   r   merged_optionsr6   rW   r   r   r   s   &&&&&&,      r%   decode_completePyJWS.decode_complete   s0    MM'',V[[]';&<> ' ?!\\N888N)*<=Jz#u7M7Mn  59JJsO1v&::eT"e+'! Z  'G II}';';D!'DQ'G&QRM""=)*U wf
 	
r(   c               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r   r   r   r1   r   r   r   r   r    r   r   r   r   r!   r   r#   )r$   s   "r%   r&   r'     sP     " "" 5" )	"
 #" '" !" 
"r(   c                	    V'       d8   \         P                  ! R \        VP                  4       4       2\        ^R7       V P                  WW4VR7      pVR,          # )zppassing additional kwargs to decode() is deprecated and will be removed in pyjwt version 3. Unsupported kwargs: rj   )r   rW   )r|   r}   r   r.   r   r   )r0   r   r1   r   r   r   r   decodeds   &&&&&&, r%   r   PyJWS.decode  sb     MM'',V[[]';&<> ' &&j<L ' 
 y!!r(   c                    V ^8  d   QhRRRR/# )r   r   r   r!   r   r#   )r$   s   "r%   r&   r'     s     	 	 	 	r(   c                X    V P                  V4      ^,          pV P                  V4       V# )zReturns back the JWT header parameters as a `dict`

Note: The signature is not verified so the header parameters
should not be fully trusted until signature verification is complete
)r   rs   )r0   r   rZ   s   && r%   get_unverified_headerPyJWS.get_unverified_header  s)     **S/!$w'r(   c                    V ^8  d   QhRRRR/# )r   r   r   r!   z*tuple[bytes, bytes, dict[str, Any], bytes]r#   )r$   s   "r%   r&   r'   &  s     $; $; $;)S $;r(   c                	N   \        V\        4      '       d   VP                  R 4      p\        V\        4      '       g   \	        R\         24      h VP                  R^4      w  r#VP                  R^4      w  rE \        T4      p \        P                  ! T4      p\        T\        4      '       g   \	        R4      h \        T4      p
 \        T4      pYY3#   \         d   p\	        R4      ThRp?ii ; i  \        \        P                  3 d   p\	        R4      ThRp?ii ; i  \         d   p	\	        RT	 24      T	hRp	?	ii ; i  \        \        P                  3 d   p\	        R4      ThRp?ii ; i  \        \        P                  3 d   p\	        R	4      ThRp?ii ; i)
rl   z$Invalid token type. Token must be a ri   zNot enough segmentsNzInvalid header paddingzInvalid header string: z,Invalid header string: must be a json objectzInvalid payload paddingzInvalid crypto padding)r?   r;   rw   rX   r   r   splitr>   r   r@   binasciiErrorru   loadsdict)r0   r   r   crypto_segmentheader_segmentpayload_segmenterrheader_datar   rS   rW   r   s   &&          r%   r   PyJWS._load&  s   c3**W%C#u%% DUGLMM	>,/JJtQ,?)M.;.A.A$.J+N	A*>:K	D%)ZZ%<F &$''LMM	B&7G	A(8I ::5  	>34#=	>
 8>>* 	A67S@	A
  	D 7s;<!C	D 8>>* 	B78cA	B
 8>>* 	A67S@	Asx   (C :C8 D' >E	 
E8 C5$C00C58D$DD$'E2EE	E5$E00E58F$FF$c               0    V ^8  d   QhRRRRRRRRRR	R
R/# )r   r   rX   r   r   r   r1   r   r   r   r!   r"   r#   )r$   s   "r%   r&   r'   L  sN     $I $I$I $I 	$I
 5$I )$I 
$Ir(   c                	   Vf$   \        V\        4      '       d   VP                  .p VR,          pT'       d   Te   Ye9  d   \	        R4      h\        T\        4      '       d   TP
                  pTP                  pM# T P                  T4      pTP                  T4      pTP                  T4      p
T
'       dK   T P                  P                  RR4      '       d   \        T
4      h\        P                  ! T
\         ^R7       TP#                  YT4      '       g   \%        R4      hR #   \         d    \	        R4      R hi ; i  \         d   p	\	        R4      T	hR p	?	ii ; i)	Nrb   zAlgorithm not specifiedz&The specified alg value is not allowedrQ   r7   Frj   zSignature verification failed)r?   r   rp   rF   r   r   r1   rT   rR   rz   r{   r   rq   r   r|   r}   r   verifyr   )r0   r   r   r   r1   r   rb   r<   prepared_keyrS   r   s   &&&&&&     r%   r   PyJWS._verify_signatureL  sB    *S%"8"8,,-J	M-C z-#2G'(PQQc5!!mmG77LN44S9 #..s3L 11,?|| <eDD%n55n.FSTU~~m9EE'(GHH F/  	M'(ABL	M ' N+,EFAMNs#   	D) ?E )EE EE rc   zset[str]_supported_critre   c               $    V ^8  d   QhRRRRRR/# )r   rZ   r   re   r]   r!   r"   r#   )r$   s   "r%   r&   r'   u  s$     ) )%)48)	)r(   c               	    R V9   d   V P                  VR ,          4       V'       g   RV9   d   V P                  V4       R# R# R# )kidcritN)_validate_kid_validate_crit)r0   rZ   re   s   &&$r%   rs   PyJWS._validate_headersu  s=     Gwu~.Fg-( .xr(   c                    V ^8  d   QhRRRR/# )r   r   r   r!   r"   r#   )r$   s   "r%   r&   r'   }  s     P P P Pr(   c                	H    \        V\        4      '       g   \        R 4      hR# )z(Key ID header parameter must be a stringN)r?   r;   r   )r0   r   s   &&r%   r   PyJWS._validate_kid}  s     #s###$NOO $r(   c                    V ^8  d   QhRRRR/# )r   rZ   r   r!   r"   r#   )r$   s   "r%   r&   r'     s      n  r(   c                	4   VR ,          p\        V\        4      '       d   \        V4      ^ 8X  d   \        R4      hV FW  p\        V\        4      '       g   \        R4      hW0P
                  9  d   \        RV 24      hW19  g   KJ  \        RV R24      h	  R# )r   z/Invalid 'crit' header: must be a non-empty listz-Invalid 'crit' header: values must be stringsz Unsupported critical extension: zCritical extension 'z' is missing from headersN)r?   r-   lenr   r;   r   )r0   rZ   r   exts   &&  r%   r   PyJWS._validate_crit  s    v$%%Ta#$UVVCc3'''(WXX...'*J3%(PQQ!'*3%/HI  r(   )r*   r,   r   )NN) NNN)r   N)__name__
__module____qualname____firstlineno__rr   r2   staticmethodr/   rB   rH   rL   rT   ro   rw   r   r   r   r   r   r   __annotations__rs   r   r   __static_attributes__r#   r(   r%   r   r   !   s    J7& O O%"(&H2 !1)-6:$)!X.t1
f",	$;L$IN "'OX');@)P r(   r   )+
__future__r   r   ru   r|   collections.abcr   typingr   r   r   r   r   r	   r
   api_jwkr   
exceptionsr   r   r   r   r   utilsr   r   r   r   r   r   typesr   objectro   r   _jws_global_objrw   r   r   rB   rH   rT   r   r#   r(   r%   <module>r      s    "    $ %    6 FA!8 l l^ '			!11			$77 &;; '== '== r(   