
    Cj                         S SK JrJr  S SKJrJrJrJrJr   " S S\5      r	 " S S\
5      r " S S\
5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      rg)    )AnyLiteral)
AnyHttpUrlAnyUrl	BaseModelFieldfield_validatorc                       \ rS rSr% Sr\\S'   Sr\S   \S'   Sr	\
S-  \S'   Sr\S-  \S'   Sr\S-  \S	'   \" SS
S9\S\S-  S\S-  4S j5       5       rSrg)
OAuthToken   z?
See https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
access_tokenBearer
token_typeN
expires_inscoperefresh_tokenbeforemodevreturnc                 P    [        U[        5      (       a  UR                  5       $ U$ N)
isinstancestrtitleclsr   s     a/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/mcp/shared/auth.pynormalize_token_typeOAuthToken.normalize_token_type   s$     a 779     )__name__
__module____qualname____firstlineno____doc__r   __annotations__r   r   r   intr   r   r	   classmethodr    __static_attributes__r#   r"   r   r   r      s     $,J!,!Jd
!E3: $M3:$\1S4Z C$J   2r"   r   c                   "    \ rS rSrS\4S jrSrg)InvalidScopeError   messagec                     Xl         g r   r0   selfr0   s     r   __init__InvalidScopeError.__init__       r"   r2   Nr$   r%   r&   r'   r   r5   r,   r#   r"   r   r.   r.           r"   r.   c                   "    \ rS rSrS\4S jrSrg)InvalidRedirectUriError    r0   c                     Xl         g r   r2   r3   s     r   r5    InvalidRedirectUriError.__init__!   r7   r"   r2   Nr8   r#   r"   r   r;   r;       r9   r"   r;   c            	          \ rS rSr% Sr\" SSS9r\\   S-  \	S'   Sr
\S   S-  \	S	'   S
S/r\\S   \-     \	S'   S/r\\   \	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\\   S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S'   Sr\S-  \	S'   \" SSSSSSS9\S\S\4S j5       5       rS \S-  S\\   S-  4S! jr S"\S-  S\4S# jr!S$r"g)%OAuthClientMetadata%   z
RFC 7591 OAuth 2.0 Dynamic Client Registration metadata.
See https://datatracker.ietf.org/doc/html/rfc7591#section-2
for the full specification.
.   
min_lengthNredirect_uris)noneclient_secret_postclient_secret_basicprivate_key_jwttoken_endpoint_auth_methodauthorization_coder   )rK   r   z+urn:ietf:params:oauth:grant-type:jwt-bearergrant_typescoderesponse_typesr   client_name
client_urilogo_uricontactstos_uri
policy_urijwks_urijwkssoftware_idsoftware_versionr   r   r   r   c                     US:X  a  g U$ )N r#   r   s     r   "_empty_string_optional_url_to_none6OAuthClientMetadata._empty_string_optional_url_to_noneJ   s     7r"   requested_scopec                     Uc  g UR                  S5      nU R                  c  / OU R                  R                  S5      nU H  nXC;  d  M
  [        SU 35      e   U$ )N z%Client was not registered with scope )splitr   r.   )r4   r]   requested_scopesallowed_scopesr   s        r   validate_scope"OAuthClientMetadata.validate_scope\   sg    "*005#zz1tzz7G7G7L%E*'*OPUw(WXX &  r"   redirect_uric                     Ub-  U R                   b  XR                   ;  a  [        SU S35      eU$ U R                   b(  [        U R                   5      S:X  a  U R                   S   $ [        S5      e)NzRedirect URI 'z' not registered for clientrB   r   zGredirect_uri must be specified when client has multiple registered URIs)rE   r;   len)r4   re   s     r   validate_redirect_uri)OAuthClientMetadata.validate_redirect_urif   su    #!!)\ASAS-S-|nLg.hii+D4F4F0G10L%%a(()*sttr"   r#   )#r$   r%   r&   r'   r(   r   rE   listr   r)   rJ   r   rL   r   rN   r   rO   rP   r   rQ   rR   rS   rT   rU   rV   r   rW   rX   r	   r+   objectr[   rc   rh   r,   r#   r"   r   r@   r@   %   s    */sq)AM4<$&A 	 VWZ^^ 		 dehkk  "(NDI(E3: #Kt"$(J
T!("&Hj4&!%Hd3i$%!%GZ$%$(J
T!("&Hj4&D#*"Kt"#'cDj' 6 f   cDj  T#Y=M  	u&4- 	uF 	ur"   r@   c                   j    \ rS rSr% SrSr\S-  \S'   Sr\S-  \S'   Sr	\
S-  \S'   Sr\
S-  \S'   Srg)	OAuthClientInformationFullr   zb
RFC 7591 OAuth 2.0 Dynamic Client Registration full response
(client information plus metadata).
N	client_idclient_secretclient_id_issued_atclient_secret_expires_atr#   )r$   r%   r&   r'   r(   ro   r   r)   rp   rq   r*   rr   r,   r#   r"   r   rm   rm   r   sC    
 !IsTz  $M3:$&*t*+/cDj/r"   rm   c                      \ rS rSr% Sr\\S'   \\S'   \\S'   Sr\S-  \S'   Sr\	\
   S-  \S'   S	/r\	\
   \S
'   Sr\	\
   S-  \S'   Sr\	\
   S-  \S'   Sr\	\
   S-  \S'   Sr\	\
   S-  \S'   Sr\S-  \S'   Sr\	\
   S-  \S'   Sr\S-  \S'   Sr\S-  \S'   Sr\S-  \S'   Sr\	\
   S-  \S'   Sr\	\
   S-  \S'   Sr\S-  \S'   Sr\	\
   S-  \S'   Sr\	\
   S-  \S'   Sr\	\
   S-  \S'   Sr\S-  \S'   Srg)OAuthMetadata~   zo
RFC 8414 OAuth 2.0 Authorization Server Metadata.
See https://datatracker.ietf.org/doc/html/rfc8414#section-2
issuerauthorization_endpointtoken_endpointNregistration_endpointscopes_supportedrM   response_types_supportedresponse_modes_supportedgrant_types_supported%token_endpoint_auth_methods_supported0token_endpoint_auth_signing_alg_values_supportedservice_documentationui_locales_supportedop_policy_uri
op_tos_urirevocation_endpoint*revocation_endpoint_auth_methods_supported5revocation_endpoint_auth_signing_alg_values_supportedintrospection_endpoint-introspection_endpoint_auth_methods_supported8introspection_endpoint_auth_signing_alg_values_supported code_challenge_methods_supported%client_id_metadata_document_supportedr#   )r$   r%   r&   r'   r(   r   r)   ry   rz   rj   r   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   boolr,   r#   r"   r   rt   rt   ~   su   
 &&/3:,3)-d3i$&-+1(d3i215d3i$.5.249t+2>B)49t+;BIM4d3i$6FM/3:,3-1$s)d*1'+M:$+$(J
T!(-1d*1CG.S	D0@GNR949t;KR04J-4FJ149t3CJQU<d3i$>NU9=$d3i$&6=9=)4$;=r"   rt   c                   Z   \ rS rSr% Sr\\S'   \" SSS9r\	\   \S'   Sr
\S-  \S	'   Sr\	\   S-  \S
'   \" S/S9r\	\   S-  \S'   Sr\	\   S-  \S'   Sr\S-  \S'   Sr\S-  \S'   Sr\S-  \S'   Sr\S-  \S'   Sr\S-  \S'   Sr\	\   S-  \S'   Sr\	\   S-  \S'   Sr\S-  \S'   Srg)ProtectedResourceMetadata   zm
RFC 9728 OAuth 2.0 Protected Resource Metadata.
See https://datatracker.ietf.org/doc/html/rfc9728#section-2
resource.rB   rC   authorization_serversNrU   rz   header)defaultbearer_methods_supported%resource_signing_alg_values_supportedresource_nameresource_documentationresource_policy_uriresource_tos_uri*tls_client_certificate_bound_access_tokens%authorization_details_types_supported!dpop_signing_alg_values_supported!dpop_bound_access_tokens_requiredr#   )r$   r%   r&   r'   r(   r   r)   r   r   rj   rU   rz   r   r   r   r   r   r   r   r   r   r   r   r   r,   r#   r"   r   r   r      s    
 .3CA.F4
+F"&Hj4&)-d3i$&-16z1Jd3i$.J>B)49t+;B $M3:$04J-4-1d*1*.j4'.>B.tB>B)49t+;B:>%tCy4'7>59%td{9r"   r   N)typingr   r   pydanticr   r   r   r   r	   r   	Exceptionr.   r;   r@   rm   rt   r   r#   r"   r   <module>r      sh     J J *	 
i 
Ju) JuZ	0!4 	0>I ><:	 :r"   