Title: Preserve empty URL paths on OAuth metadata models by Kludex · Pull Request #2925 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Preserve empty URL paths on OAuth metadata models by Kludex · Pull Request #2925 · modelcontextprotocol/python-sdk
X Title: Preserve empty URL paths on OAuth metadata models by Kludex · Pull Request #2925 · modelcontextprotocol/python-sdk
Description: Sets url_preserve_empty_path=True (Pydantic 2.12+) on OAuthMetadata, ProtectedResourceMetadata, and OAuthClientMetadata. Why A path-less URL parsed from the wire previously acquired a trailing slash (https://as.example.com → https://as.example.com/). RFC 9207 / RFC 8414 issuer comparisons require simple string comparison (RFC 3986 §6.2.1), which a spurious trailing slash defeats. With this flag, issuer/resource/authorization_servers round-trip as transmitted. This is a prerequisite for #2921 (validate the iss authorization-response parameter): once this lands, that PR can drop its _strip_authority_trailing_slash workaround and compare issuers directly. Scope The flag only affects URLs parsed from strings/JSON (the wire path). URLs constructed in Python from an already-built AnyHttpUrl object are unchanged (they were normalized at construction), so model-constructed test fixtures and existing served-metadata output are unaffected — only one test assertion needed updating. The pydantic floor is already >=2.12.0; no dependency change. AI Disclaimer This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.
Open Graph Description: Sets url_preserve_empty_path=True (Pydantic 2.12+) on OAuthMetadata, ProtectedResourceMetadata, and OAuthClientMetadata. Why A path-less URL parsed from the wire previously acquired a trailing slas...
X Description: Sets url_preserve_empty_path=True (Pydantic 2.12+) on OAuthMetadata, ProtectedResourceMetadata, and OAuthClientMetadata. Why A path-less URL parsed from the wire previously acquired a trailing slas...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2925
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ddae62bd-4476-1961-484c-7ff529207bf3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A144:A7CE4:1CB6233:268496F:6A5BB6FE |
| html-safe-nonce | bca8b0b9f63427166684493ebe1a419eda525357ac2b904b0705514a8e1c4131 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTQ0OkE3Q0U0OjFDQjYyMzM6MjY4NDk2Rjo2QTVCQjZGRSIsInZpc2l0b3JfaWQiOiIxNzEyNjEyNDY4NjkzMTIwNzY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 13fb2c8d4067ff046f07571af2dc269270c4bcf18e5469af7025be00f32dfb10 |
| hovercard-subject-tag | pull_request:3904155759 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2925/files |
| twitter:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7353520?s=400&v=4 |
| og:image:alt | Sets url_preserve_empty_path=True (Pydantic 2.12+) on OAuthMetadata, ProtectedResourceMetadata, and OAuthClientMetadata. Why A path-less URL parsed from the wire previously acquired a trailing slas... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width