-
Notifications
You must be signed in to change notification settings - Fork 432
Add SEP-991 (CIMD) support for URL-based client IDs #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add cimd support for url-based client ids Signed-off-by: tanish111 <[email protected]>
Add test coverage for is_https_url helper to validate HTTPS scheme, non-root paths, and reject http, javascript, data schemes, and invalid inputs per SEP-991 requirements. Signed-off-by: tanish111 <[email protected]>
Implements a new server example (servers_cimd_auth_streamhttp) that demonstrates CIMD (Client ID Metadata Document) support for URL-based client IDs. The server validates client_id URLs, fetches and validates client metadata documents, and provides OAuth 2.0 authorization endpoints with MCP integration for end-to-end testing. Signed-off-by: tanish111 <[email protected]>
Add CORS headers to token endpoint to allow cross-origin requests from browsers during OAuth authorization code exchange flow. Signed-off-by: tanish111 <[email protected]>
|
There's a interface set_credentials , Can it already cover CIMD? |
- Improve is_https_url function formatting and readability - Merge all test cases into single test_is_https_url_scenarios function - Add missing test case for "https://" URL Signed-off-by: tanish111 <[email protected]>
|
LGTM ,but a little grammar simplification. |
Replace the verbose match statement with map_err for more idiomatic Signed-off-by: tanish111 <[email protected]>
|
@alexhancock can you also review it? |
| const MCP_REDIRECT_URI: &str = "http://127.0.0.1:8080/callback"; | ||
| const CALLBACK_PORT: u16 = 8080; | ||
| const CALLBACK_HTML: &str = include_str!("callback.html"); | ||
| const CLIENT_METADATA_URL: &str = "https://raw.githubusercontent.com/tanish111/cimd-local-oauth-server/refs/heads/main/client-metadata.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you put one in the rust-sdk repo itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexhancock yes I can
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexhancock I have updated it with new metadata json hosted on rust-sdk repo.
Add client metadata file for SEP-991 CIMD authentication support Signed-off-by: tanish111 <[email protected]>
a8a5e92
Motivation and Context
Implement SEP-991: URL-based Client Registration (OAuth Client ID Metadata)
How Has This Been Tested?
cimd_auth_streamhttp.rs) implementing SEP-991: validates client_id URLs, fetches and validates client metadata documents, and enforces CIMD restrictions according to specs. This is tested against external CIMD-compliant testing tools (client.dev and example-app.com/client).Testing Results form client.dev for example server:-
Updated oauth_client.rs to support CIMD with 2 CLI arguments (server URL and client metadata URL). End-to-end flow verified:
Start the server using
cargo run --example servers_cimd_auth_streamhttpIn a seperate terminal run the client with
cargo run --example clients_oauth_client --package mcp-client-examples -- http://127.0.0.1:3000 https://raw.githubusercontent.com/tanish111/cimd-local-oauth-server/refs/heads/main/client-metadata.json. And complete the OAuth Flow.Added unit tests for the is_https_url helper covering valid HTTPS URLs, invalid schemes, root paths, and edge cases.
Breaking Changes
No
Types of changes
Checklist
Additional context
Fix issue #519