Remove the deprecated RFC7523OAuthClientProvider (#3169)
This commit is contained in:
parent
1963af52cc
commit
7163d8263f
1 changed files with 38 additions and 319 deletions
|
|
@ -10,11 +10,9 @@ from docs_src.oauth_clients import tutorial001, tutorial002
|
|||
from mcp.client.auth import OAuthClientProvider, OAuthFlowError, OAuthRegistrationError, OAuthTokenError, TokenStorage
|
||||
from mcp.client.auth.extensions.client_credentials import (
|
||||
PrivateKeyJWTOAuthProvider,
|
||||
RFC7523OAuthClientProvider,
|
||||
static_assertion_provider,
|
||||
)
|
||||
from mcp.shared.auth import OAuthClientInformationFull, OAuthClientMetadata, OAuthToken
|
||||
from mcp.shared.exceptions import MCPDeprecationWarning
|
||||
|
||||
# See test_index.py for why this is a per-module mark and not a conftest hook.
|
||||
pytestmark = [pytest.mark.anyio, pytest.mark.filterwarnings("error::mcp.MCPDeprecationWarning")]
|
||||
|
|
@ -104,16 +102,6 @@ async def test_the_one_more_provider_is_private_key_jwt() -> None:
|
|||
assert provider.context.client_metadata.token_endpoint_auth_method == "private_key_jwt"
|
||||
|
||||
|
||||
async def test_the_page_does_not_count_the_deprecated_provider() -> None:
|
||||
"""Why the `!!! info` says *one* more provider: `RFC7523OAuthClientProvider` warns on construction."""
|
||||
with pytest.warns(MCPDeprecationWarning, match="RFC7523OAuthClientProvider is deprecated"):
|
||||
RFC7523OAuthClientProvider(
|
||||
server_url="http://localhost:8001/mcp",
|
||||
client_metadata=tutorial001.oauth.context.client_metadata,
|
||||
storage=tutorial001.InMemoryTokenStorage(),
|
||||
)
|
||||
|
||||
|
||||
async def test_every_oauth_error_is_an_oauth_flow_error() -> None:
|
||||
"""Catch `OAuthFlowError` and you have caught registration and token failures too."""
|
||||
assert issubclass(OAuthRegistrationError, OAuthFlowError)
|
||||
|
|
|
|||
Loading…
Reference in a new issue