Skip to content

feat: add access_profile_id support to bifrost helm chart virtual key schema and helpers - #3622

Closed
BearTS wants to merge 1 commit into
devfrom
05-20-feat_support_for_helm_to_assign_vk_on_access_profile
Closed

feat: add access_profile_id support to bifrost helm chart virtual key schema and helpers#3622
BearTS wants to merge 1 commit into
devfrom
05-20-feat_support_for_helm_to_assign_vk_on_access_profile

Conversation

@BearTS

@BearTS BearTS commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for access_profile_id as a virtual key assignment option in the Bifrost Helm chart, enabling enterprise users to associate virtual keys with access profile templates.

Changes

  • Added access_profile_id field handling in the _helpers.tpl template so the value is included when constructing virtual key configurations
  • Added access_profile_id to the JSON schema as an integer type with a description noting it is enterprise-only and mutually exclusive with team_id and customer_id
  • Updated team_id and customer_id schema descriptions to reflect that they are also mutually exclusive with access_profile_id
  • Updated values.yaml comments to document the new field and the mutual exclusivity constraints across all three assignment options

Type of change

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

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Deploy the Helm chart with a virtual key configured using access_profile_id:

bifrost:
  virtualKeys:
    - name: "test-key"
      access_profile_id: 1

Verify the rendered template includes access_profile_id in the virtual key configuration:

helm template ./helm-charts/bifrost --debug

Confirm that the schema validates correctly and rejects configurations where access_profile_id is used alongside team_id or customer_id.

Screenshots/Recordings

N/A

Breaking changes

  • Yes
  • No

Related issues

Security considerations

access_profile_id is an enterprise-only field that controls access profile assignment for virtual keys. Ensure that only authorized users can set this field, as it governs access control boundaries for the associated key.

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)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for assigning virtual keys by team and by access profile (enterprise only).
    • Generated configuration now conditionally includes access profile IDs when provided.
  • Bug Fixes / Validation

    • Validation now enforces mutual exclusivity between team, customer, and access-profile assignment options.
  • Documentation

    • Example configuration updated to show access_profile_id and mutual-exclusion notes.

Walkthrough

Adds optional access_profile_id support for governance virtual keys: schema now defines team_id and access_profile_id and enforces mutual exclusivity among assignment fields; the Helm template emits access_profile_id when present and example values/comments were updated.

Changes

Virtual Keys Access Profile Support

Layer / File(s) Summary
Values schema: new fields and mutual-exclusivity validation
helm-charts/bifrost/values.schema.json
Adds team_id and access_profile_id properties to virtualKeys items and a not+anyOf rule that forbids setting any two of team_id, customer_id, or access_profile_id together.
Template emission and example values
helm-charts/bifrost/templates/_helpers.tpl, helm-charts/bifrost/values.yaml
Helm helper now conditionally includes access_profile_id on each generated governance virtual key when provided; values.yaml example adds a commented access_profile_id and broadens mutual-exclusivity comments.

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly Related PRs

  • maximhq/bifrost#3635: Updates Helm governance.virtualKeys config and schema for optional, mutually-exclusive access_profile_id.
  • maximhq/bifrost#3560: Backend/model support for access_profile_id on virtual keys that pairs with this Helm chart update.

Suggested Reviewers

  • danpiths
  • akshaydeo

Poem

🐰 A tiny key in YAML sleeps,
Conditional lines it softly keeps.
Team, customer, or profile — one to pick,
Charts whisper rules, precise and quick. 🎋

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: adding access_profile_id support to the bifrost helm chart virtual key schema and helpers.
Description check ✅ Passed The PR description is comprehensive and follows the template structure with all major sections completed: Summary, Changes, Type of change, How to test, Breaking changes, and Security considerations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-20-feat_support_for_helm_to_assign_vk_on_access_profile

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

BearTS commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

@BearTS BearTS changed the title feat: support for helm to assign vk on access profile feat: add access_profile_id support to bifrost helm chart virtual key schema and helpers May 20, 2026
@BearTS
BearTS marked this pull request as ready for review May 20, 2026 11:36
@BearTS
BearTS requested a review from a team as a code owner May 20, 2026 11:36
@coderabbitai
coderabbitai Bot requested review from akshaydeo and danpiths May 20, 2026 11:37
@greptile-apps

greptile-apps Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — all three changed files are Helm chart artifacts with no logic changes to core Go code.

The change is tightly scoped to Helm chart configuration: one new line in the template helper, a new field in the JSON schema with correct type and working mutual-exclusivity enforcement, and updated YAML comments. The not/anyOf/required schema block correctly rejects any combination of two or more of the three assignment fields, including the previously unenforced team_id+customer_id pair.

No files require special attention.

Important Files Changed

Filename Overview
helm-charts/bifrost/templates/_helpers.tpl Adds access_profile_id field to virtual key construction using the same truthiness-guard pattern as the adjacent team_id/customer_id fields
helm-charts/bifrost/values.schema.json Adds access_profile_id as integer, updates descriptions for mutual-exclusivity, and enforces all three-way constraints via a not/anyOf/required JSON Schema block
helm-charts/bifrost/values.yaml Updates comment block to document access_profile_id and the mutual-exclusivity constraints across all three assignment options

Reviews (6): Last reviewed commit: "feat: support for helm to assign vk on a..." | Re-trigger Greptile

Comment thread helm-charts/bifrost/templates/_helpers.tpl
Comment thread helm-charts/bifrost/values.schema.json

@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/templates/_helpers.tpl`:
- Line 466: The template currently checks truthiness with "if
.access_profile_id" which will skip valid zero values; change the presence check
to use hasKey so numeric zero isn't dropped: replace the conditional with
something like {{- if hasKey . "access_profile_id" }} and keep the set call {{-
$_ := set $vk "access_profile_id" .access_profile_id }} unchanged so the key is
set when the field exists even if it's 0.

In `@helm-charts/bifrost/values.schema.json`:
- Around line 1232-1243: The schema currently documents but does not enforce
that team_id, customer_id, and access_profile_id are mutually exclusive; add a
validation rule that disallows any pairwise combination by adding a "not" +
"anyOf" block at the same object schema level that contains these properties,
e.g. a "not": { "anyOf": [ { "required": ["team_id","customer_id"] }, {
"required": ["team_id","access_profile_id"] }, { "required":
["customer_id","access_profile_id"] } ] } to the object that defines team_id,
customer_id and access_profile_id so the validator rejects configs with more
than one of these keys present.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 048bae26-53a4-4ede-ac83-f25028f7329d

📥 Commits

Reviewing files that changed from the base of the PR and between da12406 and 9b9fc62.

📒 Files selected for processing (3)
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml

Comment thread helm-charts/bifrost/templates/_helpers.tpl
Comment thread helm-charts/bifrost/values.schema.json
@BearTS
BearTS force-pushed the 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff branch from da12406 to 2dffd87 Compare May 20, 2026 11:45
@BearTS
BearTS force-pushed the 05-20-feat_support_for_helm_to_assign_vk_on_access_profile branch 3 times, most recently from 7a46efe to 8fef3f3 Compare May 20, 2026 12:04
@BearTS
BearTS force-pushed the 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff branch from 2dffd87 to 4ea46e8 Compare May 20, 2026 12:04
@BearTS

BearTS commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 20, 2026
@BearTS
BearTS changed the base branch from 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff to graphite-base/3622 May 20, 2026 17:47
@BearTS
BearTS force-pushed the graphite-base/3622 branch from 4ea46e8 to 8596f7a Compare May 20, 2026 17:48
@BearTS
BearTS force-pushed the 05-20-feat_support_for_helm_to_assign_vk_on_access_profile branch from 8fef3f3 to 154b26e Compare May 20, 2026 17:48
@BearTS
BearTS changed the base branch from graphite-base/3622 to dev May 20, 2026 17:48
@BearTS
BearTS dismissed coderabbitai[bot]’s stale review May 20, 2026 17:48

The base branch was changed.

@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: 1

🤖 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 1240-1242: The schema for the property "access_profile_id"
currently allows any integer (including 0 and negatives); update the JSON Schema
entry for access_profile_id to require positive identifiers by adding "minimum":
1 to the access_profile_id definition so values must be >=1, ensuring it aligns
with the template rendering expectations; locate the access_profile_id object in
values.schema.json and add the minimum constraint alongside the existing "type":
"integer" and "description".
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37755368-e3fe-4786-9b64-9af464c60bf8

📥 Commits

Reviewing files that changed from the base of the PR and between 8fef3f3 and 154b26e.

📒 Files selected for processing (3)
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml
✅ Files skipped from review due to trivial changes (1)
  • helm-charts/bifrost/values.yaml

Comment on lines +1240 to +1242
"access_profile_id": {
"type": "integer",
"description": "Assign this virtual key to an access profile template (mutually exclusive with team_id and customer_id; enterprise only)"

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Constrain access_profile_id to positive IDs.

access_profile_id is currently any integer, so 0/negative values pass schema validation even though they are not valid identifier values and can be silently dropped in template emission paths. Add minimum: 1 to keep schema and rendering behavior aligned.

Suggested fix
                   "access_profile_id": {
                     "type": "integer",
+                    "minimum": 1,
                     "description": "Assign this virtual key to an access profile template (mutually exclusive with team_id and customer_id; enterprise only)"
                   },

As per coding guidelines "always check the stack if there is one for the current PR. do not give localized reviews for the PR, always see all changes in the light of the whole stack of PRs".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"access_profile_id": {
"type": "integer",
"description": "Assign this virtual key to an access profile template (mutually exclusive with team_id and customer_id; enterprise only)"
"access_profile_id": {
"type": "integer",
"minimum": 1,
"description": "Assign this virtual key to an access profile template (mutually exclusive with team_id and customer_id; enterprise only)"
},
🤖 Prompt for 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.

In `@helm-charts/bifrost/values.schema.json` around lines 1240 - 1242, The schema
for the property "access_profile_id" currently allows any integer (including 0
and negatives); update the JSON Schema entry for access_profile_id to require
positive identifiers by adding "minimum": 1 to the access_profile_id definition
so values must be >=1, ensuring it aligns with the template rendering
expectations; locate the access_profile_id object in values.schema.json and add
the minimum constraint alongside the existing "type": "integer" and
"description".

@BearTS
BearTS marked this pull request as draft May 20, 2026 17:51
@akshaydeo
akshaydeo force-pushed the dev branch 2 times, most recently from f59c88c to ff463d9 Compare May 22, 2026 15:16
@BearTS BearTS closed this May 23, 2026
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.

1 participant