Skip to content

Remove Teleport authentication support#687

Merged
QuentinBisson merged 7 commits into
mainfrom
worktree-remove-teleport-support
May 19, 2026
Merged

Remove Teleport authentication support#687
QuentinBisson merged 7 commits into
mainfrom
worktree-remove-teleport-support

Conversation

@QuentinBisson
Copy link
Copy Markdown
Contributor

Summary

Teleport Application Access integration is moving out of muster into a dedicated operator, so this PR rips the whole thing out of the main codebase.

What's gone

  • internal/teleport package — cert watcher, mTLS HTTP client, security helpers, adapter, tests (about 3.5k lines).
  • API surface (internal/api)TeleportClientHandler interface, RegisterTeleportClient / GetTeleportClient, TeleportClientConfig, TeleportAuth, AuthTypeTeleport, and the entire internal/api/teleport.go file.
  • MCPServer CRD (muster.giantswarm.io/v1alpha1)TeleportAuthConfig type and the MCPServerAuth.Teleport field are deleted. The auth.type enum is narrowed from oauth;teleport;none to oauth;none. Helm CRD and deepcopy are regenerated.
  • OAuth & token exchangeOAuthHandler.ExchangeTokenForRemoteClusterWithClient, TokenExchanger.ExchangeWithClient, and their adapters. The only consumer was the Teleport mTLS path; the standard ExchangeTokenForRemoteCluster covers everything else.
  • Streamable-HTTP client plumbingMCPClientConfig.HTTPClient, NewStreamableHTTPClientWithHTTPClient, NewStreamableHTTPClientWithHeaderFuncAndHTTPClient. Same story: only fed by the Teleport path.
  • Aggregator helpergetTeleportHTTPClientIfConfigured and the TeleportClientResult dual-path branches in connection_helper.go and server.go. Token-exchange and MCP-client construction are now single-path.
  • BDD scenarios — the four mcpserver-teleport-*.yaml scenarios; the proxied token-exchange scenario keeps its proxy semantics but no longer name-drops Teleport.
  • Docsdocs/how-to/teleport-authentication.md deleted; README, architecture, capabilities, problem-statement, configuration-examples, getting-started, mcp-tools, and CRD reference scrubbed of every Teleport reference. Example tool names that used x_teleport_* now use x_kubernetes_* / x_prometheus_*.
  • Helm — RBAC and values comments no longer mention teleport identity secrets.

Breaking change

Existing MCPServer CRs with auth.type: teleport or any auth.teleport block will be rejected by CRD validation after upgrade. Migrate those workloads to the new operator before rolling this out.

Verification

  • go build ./..., go vet ./..., go test ./... — clean
  • make helm-lint, make helm-test — clean
  • muster test --generate-schema regenerates schema.json with no teleport entries
  • Final grep -ri "teleport\|tbot" returns only the CHANGELOG entry that documents the removal

Net diff: 57 files, 59 insertions, 6091 deletions.

@QuentinBisson QuentinBisson marked this pull request as ready for review May 18, 2026 14:11
@QuentinBisson QuentinBisson requested a review from a team as a code owner May 18, 2026 14:11
Teleport Application Access integration has moved out of muster into a
separate operator. This change drops the entire surface:

- internal/teleport package (cert watcher, client, adapter, types)
- internal/api: TeleportClientHandler, TeleportAuth, AuthTypeTeleport,
  TeleportClientConfig, RegisterTeleportClient/GetTeleportClient
- v1alpha1 MCPServer CRD: TeleportAuthConfig type and MCPServerAuth.Teleport
  field; auth.type enum narrowed to oauth|none
- OAuthHandler.ExchangeTokenForRemoteClusterWithClient and
  TokenExchanger.ExchangeWithClient (only consumer was teleport)
- mcpserver.MCPClientConfig.HTTPClient and the *WithHTTPClient stream
  client constructors (only consumer was teleport)
- aggregator helper getTeleportHTTPClientIfConfigured and the dual-path
  branches in connection_helper.go and server.go
- BDD scenarios under internal/testing/scenarios/mcpserver-teleport-*.yaml
- docs/how-to/teleport-authentication.md and every reference in README,
  reference, getting-started, and explanation docs
- Helm RBAC/values comments referencing teleport identity secrets

Existing MCPServer CRs with auth.type: teleport or an auth.teleport block
will fail CRD validation after upgrade and must be migrated to the new
operator.
@QuentinBisson QuentinBisson force-pushed the worktree-remove-teleport-support branch from ce67066 to 98dd310 Compare May 18, 2026 14:48
Copy link
Copy Markdown
Contributor Author

@QuentinBisson QuentinBisson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Light review (DDD / SOLID / YAGNI / DRY / don't-reinvent / tests).

Removal is clean. Spot-checked: schema.json enum narrowed and teleport map removed; mockTeleportClientHandler gone; mockOAuthHandler.ExchangeTokenForRemoteClusterWithClient stub gone; helm RBAC comments scrubbed; TestConfigurationChanged case rewritten to Type: "none" rather than just deleted; whole BDD scenarios deleted as a batch (right call — they were Teleport-specific). Diff +-side grep for teleport|tsh|tbot returns only the CHANGELOG line.

Non-blocking — YAGNI

  • validateExchangeRequest and getExchangeDefaults (internal/oauth/token_exchange.go) were the DRY seam between Exchange and ExchangeWithClient. With ExchangeWithClient gone they each have a single caller. Inline back into Exchange or keep — defensible either way; flagging only because it was the seam's only reason to exist.

Copy link
Copy Markdown
Contributor

@paurosello paurosello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified hard removal is clean:

  • internal/teleport/ deleted as a unit (package + API surface)
  • auth.type CRD enum narrowed to oauth;none (helm/muster/crds/muster.giantswarm.io_mcpservers.yaml)
  • schema.json has zero teleport matches
  • pkg/apis/muster/v1alpha1/mcpserver_types.go — no TeleportAuthConfig type
  • BDD scenarios scrubbed; TestConfigurationChanged rewritten sensibly to Type: "none"
  • go build ./... and go vet ./... clean

External-consumer check (giantswarm org-wide GH code search):

  • 0 hits for auth.type: teleport in any MCPServer manifest
  • 0 hits for TeleportAuthConfig, AuthTypeTeleport, muster/internal/teleport outside this PR

CHANGELOG entry is migration-aware. No backwards-compat shim — clean break, as intended.

@QuentinBisson QuentinBisson merged commit 4bcde8d into main May 19, 2026
10 checks passed
@QuentinBisson QuentinBisson deleted the worktree-remove-teleport-support branch May 19, 2026 14:46
paurosello added a commit that referenced this pull request May 20, 2026
Conflicts:
- internal/oauth/manager.go: main added filepath.Clean to createHTTPClientWithCA
  (gosec fix in #706); this branch deleted that helper entirely. Resolved by
  keeping the deletion and dropping the now-unused os / path/filepath imports.
- CHANGELOG.md: kept both Added entries (--extra-ca-file flag and
  MCPServer.spec.family). Removed entry for the per-config CAFile knobs is
  unchanged on this side.

Picked up the Teleport-removal commit (#687) and the OTEL / instrument
refactors from main. Verified build, vet, full unit suite, and helm lint
all clean. extra-ca-file render still emits the expected --extra-ca-file
arg and the SPIFFE-bundle volume mount.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants