add bearerToken type to MCPExternalAuthConfig CRD#3224
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3224 +/- ##
==========================================
+ Coverage 64.76% 64.79% +0.02%
==========================================
Files 381 381
Lines 37121 37149 +28
==========================================
+ Hits 24043 24069 +26
+ Misses 11194 11193 -1
- Partials 1884 1887 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jhrozek
left a comment
There was a problem hiding this comment.
I'm fine adding a new type as a user shortcut, but it would be nice to, at least thinking about vmCP, reuse code when converting this to a vMCP auth strategy
|
@jhrozek would appreciate another look |
|
LGTM, but needs rebase (sorry for the late review!) |
|
LGTM again, I'm sorry but the version needs to be bumped again. Let me know when you've bumped the version on Slack so we can merge the patch ASAP. |
jhrozek
left a comment
There was a problem hiding this comment.
and you've got version 100 :-)
Honestly, I didn’t wait for it to reach 100 😄 |
* add bearerToken type to MCPExternalAuthConfig CRD * refactor to fix linting * bumped version * bumped crd version * bumped version
Summary
This PR adds bearer token authentication support to the
MCPExternalAuthConfigCRD, allowing users to configure bearer token authentication for remote MCP servers via Kubernetes Secrets.NOTE: Controller Implementation will be done in next PR
Changes
CRD Types (
cmd/thv-operator/api/v1alpha1/mcpexternalauthconfig_types.go)ExternalAuthTypeBearerTokenconstantBearerTokenConfigstruct withTokenSecretRef *SecretKeyReffieldMCPExternalAuthConfigSpecto includeBearerToken *BearerTokenConfigfieldbearerTokentypeWebhook Validation (
cmd/thv-operator/api/v1alpha1/mcpexternalauthconfig_webhook.go)bearerTokentype:BearerTokenconfig must be provided when type isbearerTokenTokenExchangeandHeaderInjectionmust not be set when type isbearerTokenBearerTokenmust not be set when type is notbearerTokenBearerTokenfieldTests (
cmd/thv-operator/api/v1alpha1/mcpexternalauthconfig_webhook_test.go)Code Generation
BearerTokenConfig)Example Usage
Security Considerations
No Plain Text: Only Kubernetes Secret references are supported
Namespace Scoped: Secrets must be in the same namespace as the MCPExternalAuthConfig
Consistent with OAuth: Follows the same security model as ClientSecretRef in token exchange
Testing
✅ All existing tests pass
✅ New bearer token validation tests pass
✅ CRD validation correctly rejects invalid configurations
✅ Deepcopy code generated successfully
Related
Part of Phase 3: Kubernetes Operator Implementation
PR 1 of 2: CRD Types and Validation (this PR)
PR 2: Controller Implementation (next)