Skip to content

fix: return error response if CAE claims are not present in WWW-Authenticate header #471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/http/httpx/kiota_http/httpx_request_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ async def get_root_parse_node(

def _should_return_none(self, response: httpx.Response) -> bool:
"""Helper function to check if the response should return None.

Conditions:
- The response status code is 204 or 304
- the response content is empty.
Expand Down Expand Up @@ -629,7 +629,7 @@ async def retry_cae_response_if_required(
):
claims_match = re.search('claims="([^"]+)"', auth_header_value)
if not claims_match:
raise ValueError("Unable to parse claims from response")
return resp
response_claims = claims_match.group(1)
parent_span.add_event(AUTHENTICATE_CHALLENGED_EVENT_KEY)
parent_span.set_attribute("http.retry_count", 1)
Expand Down