Skip to content

Commit 49812fa

Browse files
authored
Remove unimplemented pass_through auth strategy (#2753)
The pass_through authentication strategy was defined in types, validation, and documentation but was never actually implemented. This creates confusion as users might try to use it expecting it to work. - Remove BackendAuthTypePassThrough constant and enum value - Update webhook validation to remove pass_through case - Update test fixtures to use valid strategies - Remove pass_through examples from documentation - Regenerate CRD manifests and API docs
1 parent 66fff4a commit 49812fa

File tree

18 files changed

+35
-68
lines changed

18 files changed

+35
-68
lines changed

cmd/thv-operator/api/v1alpha1/virtualmcpserver_types.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ type OutgoingAuthConfig struct {
108108
// BackendAuthConfig defines authentication configuration for a backend MCPServer
109109
type BackendAuthConfig struct {
110110
// Type defines the authentication type
111-
// +kubebuilder:validation:Enum=discovered;pass_through;external_auth_config_ref
111+
// +kubebuilder:validation:Enum=discovered;external_auth_config_ref
112112
// +kubebuilder:validation:Required
113113
Type string `json:"type"`
114114

@@ -517,9 +517,6 @@ const (
517517
// BackendAuthTypeDiscovered automatically discovers from backend's externalAuthConfigRef
518518
BackendAuthTypeDiscovered = "discovered"
519519

520-
// BackendAuthTypePassThrough forwards client token unchanged
521-
BackendAuthTypePassThrough = "pass_through"
522-
523520
// BackendAuthTypeExternalAuthConfigRef references an MCPExternalAuthConfig resource
524521
BackendAuthTypeExternalAuthConfigRef = "external_auth_config_ref"
525522
)

cmd/thv-operator/api/v1alpha1/virtualmcpserver_types_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,6 @@ func TestBackendAuthConfigTypes(t *testing.T) {
273273
},
274274
isValid: true,
275275
},
276-
{
277-
name: "pass_through_auth",
278-
authConfig: BackendAuthConfig{
279-
Type: BackendAuthTypePassThrough,
280-
},
281-
isValid: true,
282-
},
283276
{
284277
name: "external_auth_config_ref_valid",
285278
authConfig: BackendAuthConfig{

cmd/thv-operator/api/v1alpha1/virtualmcpserver_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ func (*VirtualMCPServer) validateBackendAuth(backendName string, auth BackendAut
144144
return fmt.Errorf("spec.outgoingAuth.backends[%s].externalAuthConfigRef.name is required", backendName)
145145
}
146146

147-
case BackendAuthTypeDiscovered, BackendAuthTypePassThrough:
147+
case BackendAuthTypeDiscovered:
148148
// No additional validation needed
149149

150150
default:
151151
return fmt.Errorf(
152-
"spec.outgoingAuth.backends[%s].type must be one of: discovered, pass_through, service_account, external_auth_config_ref",
152+
"spec.outgoingAuth.backends[%s].type must be one of: discovered, external_auth_config_ref",
153153
backendName)
154154
}
155155

cmd/thv-operator/controllers/virtualmcpserver_vmcpconfig_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func TestConvertOutgoingAuth(t *testing.T) {
101101
outgoingAuth: &mcpv1alpha1.OutgoingAuthConfig{
102102
Source: "inline",
103103
Default: &mcpv1alpha1.BackendAuthConfig{
104-
Type: mcpv1alpha1.BackendAuthTypePassThrough,
104+
Type: mcpv1alpha1.BackendAuthTypeDiscovered,
105105
},
106106
},
107107
expectedSource: "inline",
@@ -114,7 +114,7 @@ func TestConvertOutgoingAuth(t *testing.T) {
114114
Source: "mixed",
115115
Backends: map[string]mcpv1alpha1.BackendAuthConfig{
116116
"backend-1": {
117-
Type: mcpv1alpha1.BackendAuthTypePassThrough,
117+
Type: mcpv1alpha1.BackendAuthTypeDiscovered,
118118
},
119119
},
120120
},
@@ -165,11 +165,11 @@ func TestConvertBackendAuthConfig(t *testing.T) {
165165
hasMetadata bool
166166
}{
167167
{
168-
name: "pass through",
168+
name: "discovered",
169169
authConfig: &mcpv1alpha1.BackendAuthConfig{
170-
Type: mcpv1alpha1.BackendAuthTypePassThrough,
170+
Type: mcpv1alpha1.BackendAuthTypeDiscovered,
171171
},
172-
expectedType: mcpv1alpha1.BackendAuthTypePassThrough,
172+
expectedType: mcpv1alpha1.BackendAuthTypeDiscovered,
173173
hasMetadata: false,
174174
},
175175
{
@@ -520,7 +520,7 @@ func TestYAMLMarshalingDeterminism(t *testing.T) {
520520
Type: mcpv1alpha1.BackendAuthTypeDiscovered,
521521
},
522522
"backend-alpha": {
523-
Type: mcpv1alpha1.BackendAuthTypePassThrough,
523+
Type: mcpv1alpha1.BackendAuthTypeDiscovered,
524524
},
525525
"backend-middle": {
526526
Type: mcpv1alpha1.BackendAuthTypeDiscovered,

cmd/vmcp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ incoming_auth:
6767
outgoing_auth:
6868
source: inline
6969
default:
70-
type: pass_through
70+
type: unauthenticated
7171
aggregation:
7272
conflict_resolution: prefix
7373
conflict_resolution_config:

deploy/charts/operator-crds/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: toolhive-operator-crds
33
description: A Helm chart for installing the ToolHive Operator CRDs into Kubernetes.
44
type: application
5-
version: 0.0.64
5+
version: 0.0.65
66
appVersion: "0.0.1"

deploy/charts/operator-crds/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ToolHive Operator CRDs Helm Chart
22

3-
![Version: 0.0.64](https://img.shields.io/badge/Version-0.0.64-informational?style=flat-square)
3+
![Version: 0.0.65](https://img.shields.io/badge/Version-0.0.65-informational?style=flat-square)
44
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
55

66
A Helm chart for installing the ToolHive Operator CRDs into Kubernetes.

deploy/charts/operator-crds/crds/toolhive.stacklok.dev_virtualmcpservers.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,6 @@ spec:
609609
description: Type defines the authentication type
610610
enum:
611611
- discovered
612-
- pass_through
613612
- external_auth_config_ref
614613
type: string
615614
required:
@@ -639,7 +638,6 @@ spec:
639638
description: Type defines the authentication type
640639
enum:
641640
- discovered
642-
- pass_through
643641
- external_auth_config_ref
644642
type: string
645643
required:

docs/operator/crd-api.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/operator/virtualmcpserver-api.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ spec:
9090
outgoingAuth:
9191
source: discovered
9292
default:
93-
type: pass_through
93+
type: discovered
9494
```
9595

9696
**Example (inline mode)**:
@@ -119,7 +119,7 @@ spec:
119119
outgoingAuth:
120120
source: mixed
121121
default:
122-
type: pass_through
122+
type: discovered
123123
backends:
124124
# Override specific backends while others use discovery
125125
slack:
@@ -139,10 +139,7 @@ spec:
139139
**Fields**:
140140
- `type` (string, required): Authentication type
141141
- `discovered`: Automatically discover from backend
142-
- `pass_through`: Forward client token unchanged
143-
- `service_account`: Use service account credentials
144142
- `external_auth_config_ref`: Reference an MCPExternalAuthConfig resource
145-
- `serviceAccount` (ServiceAccountAuth, optional): Service account configuration (when type=service_account)
146143
- `externalAuthConfigRef` (ExternalAuthConfigRef, optional): Auth config reference (when type=external_auth_config_ref)
147144

148145
### `.spec.aggregation` (optional)
@@ -440,7 +437,7 @@ spec:
440437
outgoingAuth:
441438
source: discovered
442439
default:
443-
type: pass_through
440+
type: discovered
444441
backends:
445442
slack: # Override for specific backend
446443
type: service_account

0 commit comments

Comments
 (0)