-
Notifications
You must be signed in to change notification settings - Fork 87
feat(router): Support custom api key and auth enable/disable in router #106
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
feat(router): Support custom api key and auth enable/disable in router #106
Conversation
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.
Pull Request Overview
This PR adds API key support to the router by updating the RouterSseTransport and MCPRouter classes, and it refactors related tests.
- Introduces an optional api_key parameter to RouterSseTransport and MCPRouter constructors.
- Updates _validate_api_key methods in both transport and router modules to check the API key.
- Adds tests in tests/test_profile.py to validate profile configuration functionality.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_profile.py | Adds tests for profile operations without altering existing functionality. |
| src/mcpm/router/transport.py | Introduces API key handling in RouterSseTransport, including new constructor parameter and updated _validate_api_key logic. |
| src/mcpm/router/router.py | Updates the router's constructor to support API key and router_config, passing the API key to the transport, and adds global configuration logic. |
Comments suppressed due to low confidence (1)
src/mcpm/router/router.py:241
- The fallback block in _validate_api_key is unreachable due to the exhaustive preceding conditions; refactor the logic to ensure clarity and remove dead code.
# Otherwise, fall back to the original validation logic
|
Updated:
|
# [1.8.0](v1.7.1...v1.8.0) (2025-04-30) ### Features * **router:** Support custom api key and auth enable/disable in router ([#106](#106)) ([bf21d42](bf21d42))
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.