Description
Add MCPOIDCConfig reference support to MCPRemoteProxy and update its controller with the same resolution and fail-closed logic as MCPServer.
Implementation Notes
Type changes: Add to MCPRemoteProxySpec in cmd/thv-operator/api/v1alpha1/mcpremoteproxy_types.go:
// OIDCConfigRef references a shared MCPOIDCConfig resource for OIDC authentication.
// When set, the referenced MCPOIDCConfig provides shared OIDC provider config.
// Per-server overrides (audience, scopes) are specified here.
// +optional
OIDCConfigRef *MCPOIDCConfigReference `json:"oidcConfigRef,omitempty"`
Add to MCPRemoteProxyStatus:
// OIDCConfigHash is the hash of the referenced MCPOIDCConfig spec for change detection
// +optional
OIDCConfigHash string `json:"oidcConfigHash,omitempty"`
Add condition type and reason constants for OIDCConfigRef validation.
Controller changes: Same resolution, fail-closed logic as MCPServer (PR #4481):
handleOIDCConfig() method: fetch MCPOIDCConfig, check Ready condition, track hash, set conditions
updateOIDCConfigReferencingWorkloads() method: ensure proxy is listed in MCPOIDCConfig status
- Add
handleOIDCConfig() call in validateAndHandleConfigs()
- Add MCPOIDCConfig watch handler in
SetupWithManager()
MCPOIDCConfig controller updates:
- Add MCPRemoteProxy scanning in
findReferencingWorkloads()
- Add MCPRemoteProxy watch in
SetupWithManager()
- Add RBAC marker for mcpremoteproxies
Runconfig updates:
- Support resolving OIDC config from MCPOIDCConfigRef in
createRunConfigFromMCPRemoteProxy()
- Fall back to existing inline
OIDCConfig when no ref is set
Testing
Unit tests:
- handleOIDCConfig: happy path ref resolution, hash tracking, fail-closed on missing/not-ready refs
- MCPOIDCConfig controller: findReferencingWorkloads includes MCPRemoteProxy
- Runconfig: MCPOIDCConfigRef resolution in run config generation
Acceptance Criteria
Description
Add MCPOIDCConfig reference support to MCPRemoteProxy and update its controller with the same resolution and fail-closed logic as MCPServer.
Implementation Notes
Type changes: Add to
MCPRemoteProxySpecincmd/thv-operator/api/v1alpha1/mcpremoteproxy_types.go:Add to
MCPRemoteProxyStatus:Add condition type and reason constants for OIDCConfigRef validation.
Controller changes: Same resolution, fail-closed logic as MCPServer (PR #4481):
handleOIDCConfig()method: fetch MCPOIDCConfig, check Ready condition, track hash, set conditionsupdateOIDCConfigReferencingWorkloads()method: ensure proxy is listed in MCPOIDCConfig statushandleOIDCConfig()call invalidateAndHandleConfigs()SetupWithManager()MCPOIDCConfig controller updates:
findReferencingWorkloads()SetupWithManager()Runconfig updates:
createRunConfigFromMCPRemoteProxy()OIDCConfigwhen no ref is setTesting
Unit tests:
Acceptance Criteria
oidcConfigReffield pointing toMCPOIDCConfigReferenceoidcConfigHashfield for change detectionfindReferencingWorkloads()task test)