feat: add dual_credential_conflict_behavior config option with UI selector for dual-auth conflict handling - #5235
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
dual_credential_conflict_behavior config option with UI selector for dual-auth conflict handling
Confidence Score: 4/5The config save path should be fixed before merging.
transports/bifrost-http/handlers/config.go Important Files Changed
Reviews (2): Last reviewed commit: "chore: add dual credential conflict beha..." | Re-trigger Greptile |
ea64c24 to
013782d
Compare
Merge activity
|
The base branch was changed.
…elector for dual-auth conflict handling (maximhq#5235) ## Summary Adds a configurable `DualCredentialConflictBehavior` setting that controls how inference requests presenting both an IDP access token (`Authorization: Bearer`) and a virtual key (`x-bf-vk`) are handled. Previously there was no explicit control over this conflict, and the behavior defaulted implicitly to preferring the IDP token. ## Changes - Added `dual_credential_conflict_behavior` to the `CoreConfig` type with allowed values `"prefer_idp"`, `"prefer_vk"`, and `"error"`, defaulting to `"prefer_idp"`. - Updated the config update handler to only write `DualCredentialConflictBehavior` when the field is explicitly provided (non-empty), preventing accidental clearing of the stored default. - Added a `Select` dropdown in the Security settings view (enterprise-only) allowing users to choose between **Prefer IDP token**, **Prefer virtual key**, and **Reject request**. - Change detection for this field treats an unset value as equivalent to `"prefer_idp"` to avoid false positives when comparing against the default. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [x] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test ```sh # Core/Transports go test ./transports/bifrost-http/... # UI cd ui pnpm i pnpm build ``` 1. Navigate to **Workspace → Config → Security** on an Enterprise instance. 2. Confirm the **Dual Credential Conflict Behavior** dropdown is visible with three options: `Prefer IDP token`, `Prefer virtual key`, and `Reject request`. 3. Change the value and save — verify the setting persists across page reloads. 4. Send an inference request with both `Authorization: Bearer <token>` and `x-bf-vk: <key>` headers and confirm the gateway behaves according to the selected mode. 5. Confirm the dropdown is **not** visible on non-Enterprise instances. ## Screenshots/Recordings _Add before/after screenshots of the Security settings panel showing the new dropdown._ ## Breaking changes - [x] No The default value (`prefer_idp`) preserves existing behavior, and the handler guard ensures an empty payload field does not overwrite a stored value. ## Related issues Link related issues and discussions. Example: Closes maximhq#123 ## Security considerations This setting directly affects authentication precedence when dual credentials are presented. Operators should review their desired behavior — choosing `"prefer_vk"` drops the IDP token entirely, and `"error"` will reject any request presenting both credentials, which may impact existing clients sending both headers. ## 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
…elector for dual-auth conflict handling (maximhq#5235) ## Summary Adds a configurable `DualCredentialConflictBehavior` setting that controls how inference requests presenting both an IDP access token (`Authorization: Bearer`) and a virtual key (`x-bf-vk`) are handled. Previously there was no explicit control over this conflict, and the behavior defaulted implicitly to preferring the IDP token. ## Changes - Added `dual_credential_conflict_behavior` to the `CoreConfig` type with allowed values `"prefer_idp"`, `"prefer_vk"`, and `"error"`, defaulting to `"prefer_idp"`. - Updated the config update handler to only write `DualCredentialConflictBehavior` when the field is explicitly provided (non-empty), preventing accidental clearing of the stored default. - Added a `Select` dropdown in the Security settings view (enterprise-only) allowing users to choose between **Prefer IDP token**, **Prefer virtual key**, and **Reject request**. - Change detection for this field treats an unset value as equivalent to `"prefer_idp"` to avoid false positives when comparing against the default. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [x] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test ```sh # Core/Transports go test ./transports/bifrost-http/... # UI cd ui pnpm i pnpm build ``` 1. Navigate to **Workspace → Config → Security** on an Enterprise instance. 2. Confirm the **Dual Credential Conflict Behavior** dropdown is visible with three options: `Prefer IDP token`, `Prefer virtual key`, and `Reject request`. 3. Change the value and save — verify the setting persists across page reloads. 4. Send an inference request with both `Authorization: Bearer <token>` and `x-bf-vk: <key>` headers and confirm the gateway behaves according to the selected mode. 5. Confirm the dropdown is **not** visible on non-Enterprise instances. ## Screenshots/Recordings _Add before/after screenshots of the Security settings panel showing the new dropdown._ ## Breaking changes - [x] No The default value (`prefer_idp`) preserves existing behavior, and the handler guard ensures an empty payload field does not overwrite a stored value. ## Related issues Link related issues and discussions. Example: Closes maximhq#123 ## Security considerations This setting directly affects authentication precedence when dual credentials are presented. Operators should review their desired behavior — choosing `"prefer_vk"` drops the IDP token entirely, and `"error"` will reject any request presenting both credentials, which may impact existing clients sending both headers. ## 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

Summary
Adds a configurable
DualCredentialConflictBehaviorsetting that controls how inference requests presenting both an IDP access token (Authorization: Bearer) and a virtual key (x-bf-vk) are handled. Previously there was no explicit control over this conflict, and the behavior defaulted implicitly to preferring the IDP token.Changes
dual_credential_conflict_behaviorto theCoreConfigtype with allowed values"prefer_idp","prefer_vk", and"error", defaulting to"prefer_idp".DualCredentialConflictBehaviorwhen the field is explicitly provided (non-empty), preventing accidental clearing of the stored default.Selectdropdown in the Security settings view (enterprise-only) allowing users to choose between Prefer IDP token, Prefer virtual key, and Reject request."prefer_idp"to avoid false positives when comparing against the default.Type of change
Affected areas
How to test
Prefer IDP token,Prefer virtual key, andReject request.Authorization: Bearer <token>andx-bf-vk: <key>headers and confirm the gateway behaves according to the selected mode.Screenshots/Recordings
Add before/after screenshots of the Security settings panel showing the new dropdown.
Breaking changes
The default value (
prefer_idp) preserves existing behavior, and the handler guard ensures an empty payload field does not overwrite a stored value.Related issues
Link related issues and discussions. Example: Closes #123
Security considerations
This setting directly affects authentication precedence when dual credentials are presented. Operators should review their desired behavior — choosing
"prefer_vk"drops the IDP token entirely, and"error"will reject any request presenting both credentials, which may impact existing clients sending both headers.Checklist
docs/contributing/README.mdand followed the guidelines