@@ -51,9 +51,7 @@ async def register_client_via_dcr(keycloak_realm_url: str, client_name_prefix: s
5151
5252 if response .status_code not in (200 , 201 ):
5353 raise RuntimeError (
54- f"DCR registration failed at { dcr_url } : "
55- f"status={ response .status_code } , "
56- f"response={ response .text } "
54+ f"DCR registration failed at { dcr_url } : status={ response .status_code } , response={ response .text } "
5755 )
5856
5957 data = response .json ()
@@ -92,19 +90,15 @@ async def get_keycloak_token(keycloak_realm_url: str, client_id: str, client_sec
9290
9391 if response .status_code != 200 :
9492 raise RuntimeError (
95- f"Token request failed at { token_url } : "
96- f"status={ response .status_code } , "
97- f"response={ response .text } "
93+ f"Token request failed at { token_url } : status={ response .status_code } , response={ response .text } "
9894 )
9995
10096 token_data = response .json ()
10197 logger .info (f"✅ Got access token (expires in { token_data .get ('expires_in' , '?' )} s)" )
10298 return token_data ["access_token" ]
10399
104100
105- async def get_auth_headers (
106- keycloak_realm_url : str | None , client_name_prefix : str = "agent"
107- ) -> dict [str , str ] | None :
101+ async def get_auth_headers (keycloak_realm_url : str | None , client_name_prefix : str = "agent" ) -> dict [str , str ] | None :
108102 """
109103 Get authorization headers if Keycloak is configured.
110104
0 commit comments