MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / test_build_metadata

Function test_build_metadata

tests/client/test_auth.py:1556–1585  ·  view source on GitHub ↗
(
    issuer_url: str,
    service_documentation_url: str,
    authorization_endpoint: str,
    token_endpoint: str,
    registration_endpoint: str,
    revocation_endpoint: str,
)

Source from the content-addressed store, hash-verified

1554 ),
1555)
1556def test_build_metadata(
1557 issuer_url: str,
1558 service_documentation_url: str,
1559 authorization_endpoint: str,
1560 token_endpoint: str,
1561 registration_endpoint: str,
1562 revocation_endpoint: str,
1563):
1564 metadata = build_metadata(
1565 issuer_url=AnyHttpUrl(issuer_url),
1566 service_documentation_url=AnyHttpUrl(service_documentation_url),
1567 client_registration_options=ClientRegistrationOptions(enabled=True, valid_scopes=["read", "write", "admin"]),
1568 revocation_options=RevocationOptions(enabled=True),
1569 )
1570
1571 assert metadata.model_dump(exclude_defaults=True, mode="json") == snapshot(
1572 {
1573 "issuer": Is(issuer_url),
1574 "authorization_endpoint": Is(authorization_endpoint),
1575 "token_endpoint": Is(token_endpoint),
1576 "registration_endpoint": Is(registration_endpoint),
1577 "scopes_supported": ["read", "write", "admin"],
1578 "grant_types_supported": ["authorization_code", "refresh_token"],
1579 "token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic"],
1580 "service_documentation": Is(service_documentation_url),
1581 "revocation_endpoint": Is(revocation_endpoint),
1582 "revocation_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic"],
1583 "code_challenge_methods_supported": ["S256"],
1584 }
1585 )
1586
1587
1588class TestLegacyServerFallback:

Callers

nothing calls this directly

Calls 3

build_metadataFunction · 0.90
RevocationOptionsClass · 0.90

Tested by

no test coverage detected