mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
address greptile review feedback (greploop iteration 12)
This commit is contained in:
parent
f953e171e1
commit
bf27a497c3
2 changed files with 7 additions and 1 deletions
|
|
@ -822,7 +822,7 @@ async def get_generic_sso_response(
|
|||
# Strip bearer credentials from received_response after conversion.
|
||||
# received_response may appear in restricted-group error messages —
|
||||
# do not expose tokens to callers.
|
||||
if received_response:
|
||||
if received_response is not None:
|
||||
received_response = {
|
||||
k: v for k, v in received_response.items() if k not in _OAUTH_TOKEN_FIELDS
|
||||
}
|
||||
|
|
@ -2687,6 +2687,8 @@ class SSOAuthenticationHandler:
|
|||
bool(token_response.get("id_token")),
|
||||
)
|
||||
|
||||
# token_response is set inside the async with block above and remains accessible here;
|
||||
# Python's scoping rules guarantee it is defined if no exception was raised.
|
||||
userinfo = await SSOAuthenticationHandler._get_pkce_userinfo(
|
||||
access_token=token_response["access_token"],
|
||||
id_token=token_response.get("id_token"),
|
||||
|
|
|
|||
|
|
@ -4553,6 +4553,10 @@ async def test_pkce_token_exchange_basic_auth():
|
|||
|
||||
assert result["access_token"] == "tok_abc"
|
||||
assert result["email"] == "user@example.com"
|
||||
# Verify userinfo GET used the correct Bearer token header
|
||||
get_call = mock_client.get.call_args
|
||||
assert get_call is not None
|
||||
assert get_call.kwargs["headers"]["Authorization"] == "Bearer tok_abc"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue