Validate the iss authorization-response parameter (RFC 9207 / SEP-2468) (#2921)
This commit is contained in:
parent
b7a5bffed0
commit
48cf4950dc
1 changed files with 335 additions and 103 deletions
|
|
@ -11,7 +11,12 @@ import pytest
|
|||
from pydantic import AnyUrl
|
||||
|
||||
from mcp.client.auth import OAuthClientProvider
|
||||
from mcp.shared.auth import OAuthClientInformationFull, OAuthClientMetadata, OAuthToken
|
||||
from mcp.shared.auth import (
|
||||
AuthorizationCodeResult,
|
||||
OAuthClientInformationFull,
|
||||
OAuthClientMetadata,
|
||||
OAuthToken,
|
||||
)
|
||||
|
||||
|
||||
class MockTokenStorage:
|
||||
|
|
@ -48,8 +53,8 @@ async def test_401_uses_www_auth_scope_not_resource_metadata_url():
|
|||
async def redirect_handler(url: str) -> None:
|
||||
pass # pragma: no cover
|
||||
|
||||
async def callback_handler() -> tuple[str, str | None]:
|
||||
return "test_auth_code", "test_state" # pragma: no cover
|
||||
async def callback_handler() -> AuthorizationCodeResult:
|
||||
return AuthorizationCodeResult(code="test_auth_code", state="test_state") # pragma: no cover
|
||||
|
||||
client_metadata = OAuthClientMetadata(
|
||||
redirect_uris=[AnyUrl("http://localhost:3030/callback")],
|
||||
|
|
|
|||
Loading…
Reference in a new issue