-
Notifications
You must be signed in to change notification settings - Fork 156
Add unauthenticated and headerinjection auth strategy to MCPExternalAuthConfig #2915
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
7e798f7 to
26df11e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2915 +/- ##
==========================================
- Coverage 56.04% 56.01% -0.04%
==========================================
Files 325 328 +3
Lines 32195 32290 +95
==========================================
+ Hits 18044 18087 +43
- Misses 12615 12668 +53
+ Partials 1536 1535 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
26df11e to
41d89b5
Compare
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.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
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 implements support for the 'unauthenticated' authentication strategy in the MCPExternalAuthConfig CRD, completing the alignment with vMCP's three supported authentication strategies: token_exchange, header_injection, and unauthenticated.
Key Changes:
- Added
ExternalAuthTypeUnauthenticatedtype constant to the CRD API - Implemented
UnauthenticatedConverterwith appropriate no-op behavior for secret resolution - Added comprehensive validation webhook to ensure mutual exclusivity of auth type configurations
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/thv-operator/api/v1alpha1/mcpexternalauthconfig_types.go | Added ExternalAuthTypeUnauthenticated constant with documentation explaining it should only be used for trusted networks |
| cmd/thv-operator/api/v1alpha1/mcpexternalauthconfig_webhook.go | Implemented validation webhook ensuring unauthenticated type has no conflicting auth configs |
| cmd/thv-operator/api/v1alpha1/mcpexternalauthconfig_webhook_test.go | Added comprehensive validation tests covering all auth types and invalid configurations |
| pkg/vmcp/auth/converters/unauthenticated.go | Implemented converter that returns strategy with no additional auth fields |
| pkg/vmcp/auth/converters/unauthenticated_test.go | Added unit tests for converter including integration with registry |
| pkg/vmcp/auth/converters/interface.go | Registered the new unauthenticated converter in the default registry |
| cmd/thv-operator/pkg/controllerutil/tokenexchange.go | Added case to handle unauthenticated type with no-op behavior |
| cmd/thv-operator/controllers/virtualmcpserver_deployment.go | Added case to skip secret mounting for unauthenticated type |
| test/e2e/thv-operator/virtualmcp/virtualmcp_external_auth_test.go | Added comprehensive e2e tests for both discovered and inline unauthenticated auth modes |
| deploy/charts/operator-crds/crds/toolhive.stacklok.dev_mcpexternalauthconfigs.yaml | Updated CRD enum to include unauthenticated type |
| docs/operator/crd-api.md | Updated API documentation with unauthenticated type description |
| deploy/charts/operator-crds/Chart.yaml | Bumped chart version from 0.0.74 to 0.0.75 |
| deploy/charts/operator-crds/README.md | Updated version badge to reflect chart version bump |
| config/webhook/manifests.yaml | Added webhook configuration for MCPExternalAuthConfig validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
Large PR justification has been provided. Thank you!
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
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cd83151 to
ae87961
Compare
8cfe29b to
fcaf921
Compare
0bc95a8 to
ab34969
Compare
ab34969 to
a2d668e
Compare
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
Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implements support for the 'unauthenticated' and header injection authentication strategy to align MCPExternalAuthConfig CRD with vMCP's supported auth strategies.
This change adds the third and final auth strategy type:
Large PR Justification
This is a complete PR adding missing modes to external auth. It adds support for unauthenticated, and properly adds missing tests for this mode and for header injection. The PR cannot be splitted if we want it to be atomic.