Skip to content

fix: Helm chart - map perUserHeaderKeys into rendered config.json - #6034

Open
CallumWayve wants to merge 2 commits into
maximhq:devfrom
CallumWayve:feat/helm-mcp-per-user-header-keys
Open

fix: Helm chart - map perUserHeaderKeys into rendered config.json#6034
CallumWayve wants to merge 2 commits into
maximhq:devfrom
CallumWayve:feat/helm-mcp-per-user-header-keys

Conversation

@CallumWayve

Copy link
Copy Markdown

Summary

Fixes #6033.

MCPClientConfig.PerUserHeaderKeys (per_user_header_keys in transports/config.schema.json) is required (non-empty) for authType: per_user_headers MCP clients — it declares the header names each caller must individually supply (e.g. Authorization). It's fully wired through the Go core, config store, and API (credential store, client manager, MCP handlers, reconciliation hash), but the Helm chart never mapped it: _helpers.tpl's clientConfigsconfig.json loop explicitly copies each field one at a time, and there was no case for perUserHeaderKeys. values.schema.json also never declared the property. So setting it under bifrost.mcp.clientConfigs[] in Helm values was silently dropped, even though authType: per_user_headers itself renders fine.

Changes

  • helm-charts/bifrost/values.schema.json — added perUserHeaderKeys (array of strings) to mcpClientConfig, matching the existing allowedExtraHeaders shape.
  • helm-charts/bifrost/templates/_helpers.tpl — maps perUserHeaderKeysper_user_header_keys in rendered config.json, same pattern as the adjacent allowedExtraHeaders mapping.
  • helm-charts/bifrost/values.yaml — added a commented per_user_headers example next to the existing oauth/oauthConfigId example.
  • helm-charts/bifrost/README.md — documented under ### Upcoming.
  • .github/workflows/scripts/validate-helm-config-fields.sh — added a fourth MCP test client (per-user-headers-server) asserting auth_type and per_user_header_keys[0..1] render correctly.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs (Helm chart + CI script)

How to test

bash .github/workflows/scripts/validate-helm-templates.sh
bash .github/workflows/scripts/validate-helm-config-fields.sh
bash .github/workflows/scripts/validate-helm-schema.sh
helm lint helm-charts/bifrost

All pass locally, including the new MCP assertions for per_user_header_keys.

Breaking changes

  • Yes
  • No

Related issues

Fixes #6033

Security considerations

None — this only affects which header names an admin declares as required; header values continue to be collected and stored per-identity through the existing per-user-headers submission flow, never through this static config.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI) — N/A, Helm-only change
  • I verified the CI pipeline passes locally if applicable

@CallumWayve
CallumWayve requested a review from a team as a code owner August 10, 2026 18:37
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a201e37f-da18-4df5-a0f4-55ecc8503f5d

📥 Commits

Reviewing files that changed from the base of the PR and between b994a6e and a439196.

📒 Files selected for processing (5)
  • .github/workflows/scripts/validate-helm-config-fields.sh
  • helm-charts/bifrost/README.md
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/scripts/validate-helm-config-fields.sh
  • helm-charts/bifrost/README.md
  • helm-charts/bifrost/values.yaml
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added Helm chart support for configuring MCP clients with per-user authentication headers.
    • Added support for specifying required header keys, such as Authorization and X-Api-Key.
    • Generated client configurations now include the selected per-user header settings.
  • Documentation

    • Added configuration examples and schema guidance for per-user header authentication.
    • Added validation guidance requiring at least one header name when this authentication method is enabled.

Walkthrough

The Helm chart now accepts perUserHeaderKeys, validates the field, renders it as per_user_header_keys, documents the configuration, and validates the rendered MCP client configuration.

Changes

Helm MCP header configuration

Layer / File(s) Summary
Schema and config rendering
helm-charts/bifrost/values.schema.json, helm-charts/bifrost/templates/_helpers.tpl, helm-charts/bifrost/values.yaml, helm-charts/bifrost/README.md
The schema defines perUserHeaderKeys as a non-empty string array for per_user_headers. The template renders it as per_user_header_keys. The example and README document the field.
Rendered configuration validation
.github/workflows/scripts/validate-helm-config-fields.sh
Validation configures a per_user_headers client and checks its authentication type and both header keys.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to a4391

This change maps per-user header names into the rendered Helm configuration and adds matching schema and validation coverage; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant HelmValues
  participant ValuesSchema
  participant HelmTemplate
  participant RenderedConfig
  participant ValidationScript
  HelmValues->>ValuesSchema: Validate perUserHeaderKeys
  HelmValues->>HelmTemplate: Provide MCP client configuration
  HelmTemplate->>RenderedConfig: Render per_user_header_keys
  ValidationScript->>RenderedConfig: Assert auth type and header keys
Loading

Possibly related PRs

  • maximhq/bifrost#6060: Modifies the same MCP Helm client configuration, schema, examples, README, and validation script.
  • maximhq/bifrost#6129: Modifies Helm MCP client serialization and schema for additional authentication-related fields.

Suggested reviewers: akshaydeo, bearts, madhuvod

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main Helm chart mapping change.
Description check ✅ Passed The description covers the purpose, changes, testing, impact, related issue, security, and checklist requirements.
Linked Issues check ✅ Passed The changes satisfy issue #6033 by declaring, rendering, documenting, and testing perUserHeaderKeys support.
Out of Scope Changes check ✅ Passed All changes are directly related to Helm support for perUserHeaderKeys and its validation, documentation, and example configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm-charts/bifrost/values.schema.json`:
- Around line 6001-6007: Update the schema around perUserHeaderKeys to
conditionally enforce it when authType is "per_user_headers": require the
property, require at least one item, and reject whitespace-only header names
using the schema’s string constraints. Keep these rules scoped to that
authentication type so the field remains optional and ignored for other authType
values.

In `@helm-charts/bifrost/values.yaml`:
- Around line 527-534: The commented HTTP example in the values configuration is
missing the required httpConfig structure. Update the example identified by
“example-per-user-headers-mcp” to define httpConfig with its url field using the
existing HTTP example shape, and remove or replace the standalone
connectionString so it passes schema validation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 52cee6f7-5506-4d57-b7be-2a17377d7d84

📥 Commits

Reviewing files that changed from the base of the PR and between d025e9c and 8390ec0.

📒 Files selected for processing (5)
  • .github/workflows/scripts/validate-helm-config-fields.sh
  • helm-charts/bifrost/README.md
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml

Comment thread helm-charts/bifrost/values.schema.json
Comment thread helm-charts/bifrost/values.yaml
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 10, 2026
@akshaydeo
akshaydeo dismissed coderabbitai[bot]’s stale review August 10, 2026 22:20

The merge-base changed after approval.

@BearTS

BearTS commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Hey @CallumWayve I am happy to take a look at this, can you please rebase the PR and ping me

@akshaydeo

Copy link
Copy Markdown
Contributor

@CallumWayve you might need to rebase this branch 🙇

@CallumWayve
CallumWayve force-pushed the feat/helm-mcp-per-user-header-keys branch from 94e1865 to 30b6cab Compare August 11, 2026 10:18
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@CallumWayve

Copy link
Copy Markdown
Author

@BearTS Rebased now

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 13, 2026
@CallumWayve

Copy link
Copy Markdown
Author

@BearTS Rebased this again now, should be entirely up to date

@akshaydeo
akshaydeo dismissed coderabbitai[bot]’s stale review August 19, 2026 08:15

The merge-base changed after approval.

MCPClientConfig.PerUserHeaderKeys (per_user_header_keys) is required
(non-empty) for authType per_user_headers MCP clients, but the
clientConfigs -> config.json template in _helpers.tpl never mapped it,
so it silently dropped out of Helm-rendered config regardless of what
was set in values.yaml. values.schema.json also never declared the
property. Fixes maximhq#6033.

Affected packages:
- helm-charts/bifrost/values.schema.json
- helm-charts/bifrost/templates/_helpers.tpl
- helm-charts/bifrost/values.yaml
- helm-charts/bifrost/README.md
- .github/workflows/scripts/validate-helm-config-fields.sh
…er_headers

Address review feedback on the previous commit:
- values.schema.json now requires perUserHeaderKeys (non-empty, no
  whitespace-only entries) via an allOf/if/then keyed on authType, scoped
  to per_user_headers only — other auth types are unaffected.
- values.yaml's per_user_headers example used a bare connectionString
  with connectionType: http, which the schema requires httpConfig for;
  fixed to use httpConfig.url like the adjacent http example.

Affected packages:
- helm-charts/bifrost/values.schema.json
- helm-charts/bifrost/values.yaml
@CallumWayve
CallumWayve force-pushed the feat/helm-mcp-per-user-header-keys branch from 4638e55 to a439196 Compare August 19, 2026 10:18
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@CallumWayve

Copy link
Copy Markdown
Author

Hey @CallumWayve I am happy to take a look at this, can you please rebase the PR and ping me

Hi @BearTS, this has been rebased again and is ready for review.

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.

Helm chart: mcp.clientConfigs[].perUserHeaderKeys not rendered into config.json

3 participants