Skip to content

Commit dc6b9ea

Browse files
committed
Update conformance client to httpx2
1 parent ac69e24 commit dc6b9ea

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/actions/conformance/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from typing import Any, cast
3939
from urllib.parse import parse_qs, urlparse
4040

41-
import httpx
41+
import httpx2
4242
import mcp_types as types
4343
from mcp_types.version import MODERN_PROTOCOL_VERSIONS
4444
from pydantic import AnyUrl
@@ -151,7 +151,7 @@ async def handle_redirect(self, authorization_url: str) -> None:
151151
"""Fetch the authorization URL and extract the auth code from the redirect."""
152152
logger.debug(f"Fetching authorization URL: {authorization_url}")
153153

154-
async with httpx.AsyncClient() as client:
154+
async with httpx2.AsyncClient() as client:
155155
response = await client.get(
156156
authorization_url,
157157
follow_redirects=False,
@@ -486,13 +486,13 @@ async def run_enterprise_managed_authorization(server_url: str) -> None:
486486
# learn it from the harness's PRM document (RFC 9728); production
487487
# deployments would supply it as static configuration instead.
488488
prm_url = build_protected_resource_metadata_discovery_urls(None, server_url)[0]
489-
async with httpx.AsyncClient(timeout=30.0) as http:
489+
async with httpx2.AsyncClient(timeout=30.0) as http:
490490
prm = (await http.get(prm_url)).raise_for_status().json()
491491
as_issuer = prm["authorization_servers"][0]
492492

493493
async def fetch_id_jag(audience: str, resource: str) -> str:
494494
"""Leg 1 - RFC 8693 token-exchange at the enterprise IdP."""
495-
async with httpx.AsyncClient(timeout=30.0) as http:
495+
async with httpx2.AsyncClient(timeout=30.0) as http:
496496
resp = await http.post(
497497
idp_token_endpoint,
498498
data={
@@ -563,9 +563,9 @@ async def run_auth_code_client(server_url: str) -> None:
563563
await _run_auth_session(server_url, oauth_auth)
564564

565565

566-
async def _run_auth_session(server_url: str, oauth_auth: httpx.Auth) -> None:
566+
async def _run_auth_session(server_url: str, oauth_auth: httpx2.Auth) -> None:
567567
"""Common session logic for all OAuth flows."""
568-
http_client = httpx.AsyncClient(auth=oauth_auth, timeout=30.0)
568+
http_client = httpx2.AsyncClient(auth=oauth_auth, timeout=30.0)
569569
transport = streamable_http_client(url=server_url, http_client=http_client)
570570
async with Client(transport, mode=client_mode(), elicitation_callback=default_elicitation_callback) as client:
571571
logger.debug("Initialized successfully")

0 commit comments

Comments
 (0)