Skip to content

Commit 73b12b7

Browse files
committed
- Resolved pyright errors.
1 parent 005bad4 commit 73b12b7

File tree

2 files changed

+73
-83
lines changed

2 files changed

+73
-83
lines changed

src/mcp/client/auth/extensions/enterprise_managed_auth.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77

88
import logging
9-
from collections.abc import Awaitable, Callable
9+
from typing import Any
1010

1111
import httpx
1212
from pydantic import BaseModel, Field
@@ -166,8 +166,8 @@ def __init__(
166166
storage: TokenStorage,
167167
idp_token_endpoint: str,
168168
token_exchange_params: TokenExchangeParameters,
169-
redirect_handler: Callable[[str], Awaitable[None]] | None = None,
170-
callback_handler: Callable[[], Awaitable[tuple[str, str | None]]] | None = None,
169+
redirect_handler: Any = None,
170+
callback_handler: Any = None,
171171
timeout: float = 300.0,
172172
) -> None:
173173
"""
@@ -241,11 +241,11 @@ async def exchange_token_for_id_jag(
241241
)
242242

243243
if response.status_code != 200:
244-
error_data: dict[str, object] = (
244+
error_data: dict[str, str] = (
245245
response.json() if response.headers.get("content-type", "").startswith("application/json") else {}
246246
)
247-
error = str(error_data.get("error", "unknown_error"))
248-
error_description = str(error_data.get("error_description", "Token exchange failed"))
247+
error: str = error_data.get("error", "unknown_error")
248+
error_description: str = error_data.get("error_description", "Token exchange failed")
249249
raise OAuthTokenError(f"Token exchange failed: {error} - {error_description}")
250250

251251
# Parse response
@@ -312,11 +312,11 @@ async def exchange_id_jag_for_access_token(
312312
)
313313

314314
if response.status_code != 200:
315-
error_data: dict[str, object] = (
315+
error_data: dict[str, str] = (
316316
response.json() if response.headers.get("content-type", "").startswith("application/json") else {}
317317
)
318-
error = str(error_data.get("error", "unknown_error"))
319-
error_description = str(error_data.get("error_description", "JWT bearer grant failed"))
318+
error: str = error_data.get("error", "unknown_error")
319+
error_description: str = error_data.get("error_description", "JWT bearer grant failed")
320320
raise OAuthTokenError(f"JWT bearer grant failed: {error} - {error_description}")
321321

322322
# Parse OAuth token response

0 commit comments

Comments
 (0)