+
    P(iT"                     z    ^ 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# )    )default_json_headers)	JoseError)AccessDeniedError)InvalidClientError)InvalidRequestError)UnauthorizedClientError)InvalidClientMetadataError)ClientMetadataClaimsc                      a  ] tR t^t o 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R tR tRtV tR# )ClientConfigurationEndpointclient_configurationNc                >    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/rfc7592/endpoint.py__init__$ClientConfigurationEndpoint.__init__   s    ,FF1E0F    c                $    V P                  V4      # r   )create_configuration_responser   requests   &&r   __call__$ClientConfigurationEndpoint.__call__   s    11'::r   c                   V P                  V4      pV'       g   \        4       hW!n        V P                  V4      pV'       g   V P	                  W4       \        R RR7      hV P                  W14      '       g   \        RRR7      hW1n        VP                  R8X  d   V P                  W14      # VP                  R8X  d   V P                  W14      # VP                  R8X  d   V P                  W14      # R# )	i  z)The client does not exist on this server.)status_codedescriptioni  z7The client does not have permission to read its record.GETDELETEPUTN)authenticate_tokenr   
credentialauthenticate_clientrevoke_access_tokenr   check_permissionr   clientmethodcreate_read_client_responsecreate_delete_client_responsecreate_update_client_response)r   r   tokenr(   s   &&  r   r   9ClientConfigurationEndpoint.create_configuration_response   s     ''0#%%"))'2 $$W4$-X  $$V55 *U 
  >>U"33FDD^^x'55fFF^^u$55fFF %r   c                8    V P                   P                  V4      # r   )r   create_json_requestr   s   &&r   create_endpoint_request3ClientConfigurationEndpoint.create_endpoint_request:   s    {{..w77r   c                v    V P                  V4      pVP                  V P                  W4      4       ^V\        3# )   )introspect_clientupdate!generate_client_registration_infor   )r   r(   r   bodys   &&& r   r*   7ClientConfigurationEndpoint.create_read_client_response=   s7    %%f-D::6KLD...r   c                6    V P                  W4       RR.p^RV3# )Cache-Control )r;   zno-store)Pragmazno-cache)delete_client)r   r(   r   headerss   &&& r   r+   9ClientConfigurationEndpoint.create_delete_client_responseB   s,    6+)"
 Br   c                    RpV F'  pWBP                   P                  9   g   K  \        4       h	  VP                   P                  P                  R4      pV'       g   \        4       hWQP	                  4       8w  d   \        4       hRVP                   P                  9   d=   VP                  VP                   P                  R,          4      '       g   \        4       hV P                  V4      pV P                  WV4      pV P                  W4      # )registration_access_token	client_idclient_secret)rB   registration_client_uriclient_secret_expires_atclient_id_issued_at)	payloaddatar   getget_client_idcheck_client_secretextract_client_metadataupdate_clientr*   )r   r(   r   must_not_includekrC   client_metadatas   &&&    r   r,   9ClientConfigurationEndpoint.create_update_client_responseJ   s    
 "AOO((()++ "
 OO((,,[9	%'',,..%''
 goo222--goo.B.B?.STT)++66w?##FWE//@@r   c                   VP                   P                  P                  4       p/ pV P                  4       pV P                   Fk  p\        VR 4      '       d   V'       d   VP                  V4      M/ pV! V/ Wd4      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)get_claims_optionsN )rH   rI   copyget_server_metadatar   hasattrrT   validater   r	   r   r6   get_registered_claims)	r   r   	json_datarQ   server_metadataclaims_classoptionsclaimserrors	   &&       r   rM   3ClientConfigurationEndpoint.extract_client_metadataj   s    OO((--/	224 //L <)=>>? //@ 
 ")RJFO! ""DV%A%A%CD 0 	  O01B1BCNOs   >B44C?CCc                6    / VP                   CVP                  C# r   )client_inforQ   )r   r(   s   &&r   r5   -ClientConfigurationEndpoint.introspect_client}   s    ?&$$?(>(>??r   c                    \        4       h)aX  Generate ```registration_client_uri`` and ``registration_access_token``
for RFC7592. By default this method returns the values sent in the current
request. Developers MUST rewrite this method to return different registration
information.::

    def generate_client_registration_info(self, client, request):{
        access_token = request.headers['Authorization'].split(' ')[1]
        return {
            'registration_client_uri': request.uri,
            'registration_access_token': access_token,
        }

:param client: the instance of OAuth client
:param request: formatted request instance
NotImplementedErrorr   r(   r   s   &&&r   r7   =ClientConfigurationEndpoint.generate_client_registration_info         "##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
rf   r   s   &&r   r#   .ClientConfigurationEndpoint.authenticate_token        "##r   c                    \        4       h)a  Read a client from the request payload.
Developers MUST implement this method in subclass::

    def authenticate_client(self, request):
        client_id = request.payload.data.get("client_id")
        return Client.get(client_id=client_id)

:return: client instance
rf   r   s   &&r   r%   /ClientConfigurationEndpoint.authenticate_client   rm   r   c                    \        4       h)zRevoke a token access in case an invalid client has been requested.
Developers MUST implement this method in subclass::

    def revoke_access_token(self, token, request):
        token.revoked = True
        token.save()

rf   )r   r-   r   s   &&&r   r&   /ClientConfigurationEndpoint.revoke_access_token        "##r   c                    \        4       h)zChecks whether the current client is allowed to be accessed, edited
or deleted. Developers MUST implement it in subclass, e.g.::

    def check_permission(self, client, request):
        return client.editable

:return: boolean
rf   rh   s   &&&r   r'   ,ClientConfigurationEndpoint.check_permission   rr   r   c                    \        4       h)a  Delete authorization code from database or cache. Developers MUST
implement it in subclass, e.g.::

    def delete_client(self, client, request):
        client.delete()

:param client: the instance of OAuth client
:param request: formatted request instance
rf   rh   s   &&&r   r>   )ClientConfigurationEndpoint.delete_client   rm   r   c                    \        4       h)a  Update the client in the database. Developers MUST implement this method
in subclass::

    def update_client(self, client, client_metadata, request):
        client.set_client_metadata(
            {**client.client_metadata, **client_metadata}
        )
        client.save()
        return client

:param client: the instance of OAuth client
:param client_metadata: a dict of the client claims to update
:param request: formatted request instance
:return: client instance
rf   )r   r(   rQ   r   s   &&&&r   rN   )ClientConfigurationEndpoint.update_client   rj   r   c                    \        4       h)zUReturn server metadata which includes supported grant types,
response types and etc.
rf   )r   s   &r   rW   /ClientConfigurationEndpoint.get_server_metadata   s     "##r   )r   r   )NN)__name__
__module____qualname____firstlineno__ENDPOINT_NAMEr   r   r   r1   r*   r+   r,   rM   r5   r7   r#   r%   r&   r'   r>   rN   rW   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sj     *MG;"GH8/
 A@&@$$
$
$	$	$
$$$$ $r   r   N)authlib.constsr   authlib.joser   rfc6749r   r   r   r   rfc7591r	   rfc7591.claimsr
   r   rU   r   r   <module>r      s)    / " ' ( ) - 0 1V$ V$r   