|
27 | 27 | ClientRegistrationOptions, |
28 | 28 | RevocationOptions, |
29 | 29 | create_auth_routes, |
30 | | - create_protected_resource_routes, |
31 | 30 | ) |
32 | 31 | from mcp.shared.auth import ( |
33 | 32 | OAuthClientInformationFull, |
@@ -251,32 +250,6 @@ async def registered_client(test_client: httpx.AsyncClient, request): |
251 | 250 | return client_info |
252 | 251 |
|
253 | 252 |
|
254 | | -@pytest.fixture |
255 | | -def protected_resource_app(): |
256 | | - """Fixture to create protected resource routes for testing.""" |
257 | | - |
258 | | - # Create the protected resource routes |
259 | | - protected_resource_routes = create_protected_resource_routes( |
260 | | - resource_url=AnyHttpUrl("https://example.com/resource"), |
261 | | - authorization_servers=[AnyHttpUrl("https://auth.example.com/authorization")], |
262 | | - scopes_supported=["read", "write"], |
263 | | - resource_name="Example Resource", |
264 | | - resource_documentation=AnyHttpUrl("https://docs.example.com/resource"), |
265 | | - ) |
266 | | - |
267 | | - app = Starlette(routes=protected_resource_routes) |
268 | | - return app |
269 | | - |
270 | | - |
271 | | -@pytest.fixture |
272 | | -async def protected_resource_test_client(protected_resource_app: Starlette): |
273 | | - """Fixture to create an HTTP client for the protected resource app.""" |
274 | | - async with httpx.AsyncClient( |
275 | | - transport=httpx.ASGITransport(app=protected_resource_app), base_url="https://mcptest.com" |
276 | | - ) as client: |
277 | | - yield client |
278 | | - |
279 | | - |
280 | 253 | @pytest.fixture |
281 | 254 | def pkce_challenge(): |
282 | 255 | """Create a PKCE challenge with code_verifier and code_challenge.""" |
@@ -1225,23 +1198,3 @@ async def test_authorize_invalid_scope(self, test_client: httpx.AsyncClient, reg |
1225 | 1198 | assert "state" in query_params |
1226 | 1199 | assert query_params["state"][0] == "test_state" |
1227 | 1200 |
|
1228 | | - |
1229 | | -class TestProtectedResourceMetadata: |
1230 | | - """Test the Protected Resource Metadata model.""" |
1231 | | - |
1232 | | - @pytest.mark.anyio |
1233 | | - async def test_metadata_endpoint(self, protected_resource_test_client: httpx.AsyncClient): |
1234 | | - """Test the OAuth 2.0 Protected Resource metadata endpoint.""" |
1235 | | - |
1236 | | - response = await protected_resource_test_client.get("/.well-known/oauth-protected-resource") |
1237 | | - metadata = response.json() |
1238 | | - assert metadata == snapshot( |
1239 | | - { |
1240 | | - "resource": "https://example.com/resource", |
1241 | | - "authorization_servers": ["https://auth.example.com/authorization"], |
1242 | | - "scopes_supported": ["read", "write"], |
1243 | | - "resource_name": "Example Resource", |
1244 | | - "resource_documentation": "https://docs.example.com/resource", |
1245 | | - "bearer_methods_supported": ["header"], |
1246 | | - } |
1247 | | - ) |
0 commit comments