Skip to content

Commit 3490ae9

Browse files
Merge branch 'modelcontextprotocol:main' into ReuelAlbert-Dev-patch-1
2 parents 1810eb9 + ef4e167 commit 3490ae9

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

src/mcp/shared/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,20 @@ class OAuthMetadata(BaseModel):
114114
registration_endpoint: AnyHttpUrl | None = None
115115
scopes_supported: list[str] | None = None
116116
response_types_supported: list[str] = ["code"]
117-
response_modes_supported: list[Literal["query", "fragment", "form_post"]] | None = None
117+
response_modes_supported: list[str] | None = None
118118
grant_types_supported: list[str] | None = None
119119
token_endpoint_auth_methods_supported: list[str] | None = None
120-
token_endpoint_auth_signing_alg_values_supported: None = None
120+
token_endpoint_auth_signing_alg_values_supported: list[str] | None = None
121121
service_documentation: AnyHttpUrl | None = None
122122
ui_locales_supported: list[str] | None = None
123123
op_policy_uri: AnyHttpUrl | None = None
124124
op_tos_uri: AnyHttpUrl | None = None
125125
revocation_endpoint: AnyHttpUrl | None = None
126126
revocation_endpoint_auth_methods_supported: list[str] | None = None
127-
revocation_endpoint_auth_signing_alg_values_supported: None = None
127+
revocation_endpoint_auth_signing_alg_values_supported: list[str] | None = None
128128
introspection_endpoint: AnyHttpUrl | None = None
129129
introspection_endpoint_auth_methods_supported: list[str] | None = None
130-
introspection_endpoint_auth_signing_alg_values_supported: None = None
130+
introspection_endpoint_auth_signing_alg_values_supported: list[str] | None = None
131131
code_challenge_methods_supported: list[str] | None = None
132132

133133

tests/shared/test_auth.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,25 @@ def test_oidc(self):
3737
"userinfo_endpoint": "https://example.com/oauth2/userInfo",
3838
}
3939
)
40+
41+
def test_oauth_with_jarm(self):
42+
"""Should not throw when parsing OAuth metadata that includes JARM response modes."""
43+
OAuthMetadata.model_validate(
44+
{
45+
"issuer": "https://example.com",
46+
"authorization_endpoint": "https://example.com/oauth2/authorize",
47+
"token_endpoint": "https://example.com/oauth2/token",
48+
"scopes_supported": ["read", "write"],
49+
"response_types_supported": ["code", "token"],
50+
"response_modes_supported": [
51+
"query",
52+
"fragment",
53+
"form_post",
54+
"query.jwt",
55+
"fragment.jwt",
56+
"form_post.jwt",
57+
"jwt",
58+
],
59+
"token_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post"],
60+
}
61+
)

0 commit comments

Comments
 (0)