+
    P(i                         ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RI	Ht ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RIHt  ! R R4      tR# )    Ngenerate_token)default_json_headers)	deprecate)	JoseError)JsonWebToken)AccessDeniedError)InvalidRequestError)ClientMetadataClaims)InvalidClientMetadataError)InvalidSoftwareStatementError) UnapprovedSoftwareStatementErrorc                      a  ] tR t^t o RtRtRtRR ltR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tRtV tR# )ClientRegistrationEndpointzThe client registration endpoint is an OAuth 2.0 endpoint designed to
allow a client to be registered with the authorization server.
client_registrationNc                >    Wn         T;'       g    \        .V n        R # N)serverr   claims_classes)selfr   r   s   &&&e/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/authlib/oauth2/rfc7591/endpoint.py__init__#ClientRegistrationEndpoint.__init__   s    ,FF1E0F    c                $    V P                  V4      # r   )create_registration_responser   requests   &&r   __call__#ClientRegistrationEndpoint.__call__"   s    0099r   c                j   V P                  V4      pV'       g   \        4       hW!n        V P                  V4      pV P	                  V4      p/ pVP                  V4       VP                  V4       V P                  WCV4      pV P                  Wa4      pV'       d   VP                  V4       ^V\        3# )   )	authenticate_tokenr	   
credentialextract_client_metadatagenerate_client_infoupdatesave_client!generate_client_registration_infor   )r   r   tokenclient_metadataclient_infobodyclientregistration_infos   &&      r   r   7ClientRegistrationEndpoint.create_registration_response%   s    ''0#%%"66w?//8O$K !!+H BB6SKK)*D...r   c                   VP                   P                  '       g   \        4       hVP                   P                  P                  4       pVP	                  R R4      pV'       d5   V P
                  '       d#   V P                  W14      pVP                  V4       / pV P                  4       pV P                   Fk  p\        VR4      '       d   V'       d   VP                  V4      M/ pV! V/ W4      p	 V	P                  4        TP                  ! R/ T	P!                  4       B  Km  	  V#   \         d   p
\        T
P                  4      T
hRp
?
ii ; i)software_statementNget_claims_options )payloaddatar
   copypop'software_statement_alg_values_supportedextract_software_statementr'   get_server_metadatar   hasattrr3   validater   r   descriptionget_registered_claims)r   r   	json_datar2   r6   r+   server_metadataclaims_classoptionsclaimserrors   &&         r   r%   2ClientRegistrationEndpoint.extract_client_metadata7   s*   ###%''OO((--/	&]]+?F$"N"N"N223EODT"224 //L <)=>>? //@ 
 ")RJFO! ""DV%A%A%CD 0 	  O01B1BCNOs   2D((E3E		Ec                    V P                  V4      pV'       g   \        4       h \        V P                  4      pVP	                  W4      pV#   \
         d   p\        4       ThR p?ii ; ir   )resolve_public_keyr   r   r9   decoder   r   )r   r2   r   keyjwtrD   excs   &&&    r   r:   5ClientRegistrationEndpoint.extract_software_statementR   sb    %%g.244	;tKKLCZZ 28FM 	;/1s:	;s   'A A(A##A(c                `    V P                  V4      p V P                  V4      p\	        \
        P
                  ! 4       4      p^ p\        VVVVR7      #   \         d!    T P                  4       p\        R RR7        Lki ; i  \         d!    T P                  4       p\        RRR7        Li ; i)z[generate_client_id takes a 'request' parameter. It will become mandatory in coming releasesz1.8)versionz_generate_client_secret takes a 'request' parameter. It will become mandatory in coming releases)	client_idclient_secretclient_id_issued_atclient_secret_expires_at)generate_client_id	TypeErrorr   generate_client_secretinttimedict)r   r   rP   rQ   rR   rS   s   &&    r   r&   /ClientRegistrationEndpoint.generate_client_info_   s    	//8I	 77@M "$))+.#$ ' 3%=	
 	
)  	//1I>	  	 779M>	s"   A B (A?>A?(B-,B-c                    R# )zGenerate ```registration_client_uri`` and ``registration_access_token``
for RFC7592. This method returns ``None`` by default. Developers MAY rewrite
this method to return registration information.
Nr4   )r   r.   r   s   &&&r   r)   <ClientRegistrationEndpoint.generate_client_registration_info~   s    
 r   c                8    V P                   P                  V4      # r   )r   create_json_requestr   s   &&r   create_endpoint_request2ClientRegistrationEndpoint.create_endpoint_request   s    {{..w77r   c                    \        ^*4      # )zqGenerate ``client_id`` value. Developers MAY rewrite this method
to use their own way to generate ``client_id``.
r   r   s   &&r   rT   -ClientRegistrationEndpoint.generate_client_id   s     b!!r   c                t    \         P                  ! \        P                  ! ^4      4      P	                  R4      # )zyGenerate ``client_secret`` value. Developers MAY rewrite this method
to use their own way to generate ``client_secret``.
ascii)binasciihexlifyosurandomrI   r   s   &&r   rV   1ClientRegistrationEndpoint.generate_client_secret   s(     

2/66w??r   c                    \        4       h)zUReturn server metadata which includes supported grant types,
response types and etc.
NotImplementedError)r   s   &r   r;   .ClientRegistrationEndpoint.get_server_metadata   s     "##r   c                    \        4       h)a  Authenticate current credential who is requesting to register a client.
Developers MUST implement this method in subclass::

    def authenticate_token(self, request):
        auth = request.headers.get("Authorization")
        return get_token_by_auth(auth)

:return: token instance
rk   r   s   &&r   r#   -ClientRegistrationEndpoint.authenticate_token        "##r   c                    \        4       h)a  Resolve a public key for decoding ``software_statement``. If
``enable_software_statement=True``, developers MUST implement this
method in subclass::

    def resolve_public_key(self, request):
        return get_public_key_from_user(request.credential)

:return: JWK or Key string
rk   r   s   &&r   rH   -ClientRegistrationEndpoint.resolve_public_key   rp   r   c                    \        4       h)a^  Save client into database. Developers MUST implement this method
in subclass::

    def save_client(self, client_info, client_metadata, request):
        client = OAuthClient(
            client_id=client_info['client_id'],
            client_secret=client_info['client_secret'],
            ...
        )
        client.save()
        return client
rk   )r   r,   r+   r   s   &&&&r   r(   &ClientRegistrationEndpoint.save_client   s     "##r   )r   r   )NN)__name__
__module____qualname____firstlineno____doc__ENDPOINT_NAMEr9   r   r   r   r%   r:   r&   r)   r_   rT   rV   r;   r#   rH   r(   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sf      *M /3+G:/$6;
>8"@$
$
$$ $r   r   )re   rg   rX   authlib.common.securityr   authlib.constsr   authlib.deprecater   authlib.joser   r   rfc6749r	   r
   rD   r   errorsr   r   r   r   r4   r   r   <module>r      s;     	  2 / ' " % ' ) ( . 1 4l$ l$r   