fix: use scopes_supported in OAuth server metadata#30
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
gao-sun
approved these changes
Jul 10, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR aligns the OAuth metadata field name with RFC8414 by replacing scope_supported with scopes_supported.
- Renamed
scope_supportedtoscopes_supportedin the metadata model and updated its docstring. - Updated existing tests to check
scopes_supportedinstead of the old field.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/utils/fetch_server_config_test.py | Added assertions for the new scopes_supported field |
| mcpauth/config.py | Renamed attribute and added RFC link in its docstring |
Comments suppressed due to low confidence (2)
mcpauth/config.py:141
- Consider adding a fallback for servers that still emit the older
scope_supportedkey (e.g., via Pydantic'sField(alias='scope_supported', alias_priority=2)) to maintain broader interoperability.
scopes_supported: Optional[List[str]] = None
mcpauth/config.py:143
- [nitpick] Attribute-level docstrings aren't picked up by many tools; consider using
Field(..., description="...")so the description becomes part of the Pydantic model schema and generated docs.
JSON array containing a list of the OAuth 2.0 `scope` values that this authorization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to the RFC, the supported scopes filed name should be scopes_supported rather than scope_supported.