stacklok / stacklok/toolhive

Remove vestigial inline authzConfig ConfigMap and volume mount

Open
#5,569 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

Background

The operator never sets RunConfig.AuthzConfigPath, so the standalone authz ConfigMap the operator materializes from spec.authzConfig (via EnsureAuthzConfigMap) and mounts at /etc/toolhive/authz (via GenerateAuthzVolumeConfig) is never read. Enforcement happens entirely through the authz config embedded in the RunConfig (addAuthzInlineConfigOptions -> WithAuthzConfig), which the proxy reads from /etc/runconfig/runconfig.json.

The equivalent ref path (spec.authzConfigRef) was removed in #5564 (commit "Stop materializing authzConfigRef into an unread ConfigMap"). The inline path is equally vestigial but pre-existing, so it was left untouched there to keep that change scoped.

Originally flagged by @jhrozek in review of #5563 (the inline GenerateAuthzVolumeConfig is "equally unread").

Scope

  • Remove the inline authz ConfigMap materialization (EnsureAuthzConfigMap) and its volume mount (GenerateAuthzVolumeConfig) from mcpserver_controller.go and mcpremoteproxy_controller.go / mcpremoteproxy_deployment.go.
  • Delete the helpers and their tests once unused.
  • Confirm nothing reads the mounted file (no AuthzConfigPath is ever set in the operator path).

NOTE: the user-supplied authzConfig.type: configMap input (read via LoadAuthzConfigFromConfigMap) is a separate, genuinely-read mechanism — do not remove that.

Tracked as a follow-up to #5564.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mcpserver_controller.go and mcpremoteproxy_controller.go or mcpremoteproxy_deployment.go, then locate EnsureAuthzConfigMap, GenerateAuthzVolumeConfig, and their tests. Remove the unused materialization and mount, confirm the operator never sets AuthzConfigPath, and run the affected tests while preserving LoadAuthzConfigFromConfigMap.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.