Conversation
…iew maintenance (#5693) * feat: support matview_refresh_interval "off" to disable logstore matview maintenance The materialized views back only the dashboard UI. Deployments that run Bifrost headless behind their own observability stack pay the REFRESH MATERIALIZED VIEW CONCURRENTLY cost for views nothing reads, and the 5s floor means the interval alone cannot turn maintenance off. With "off" (or a non-positive duration) the logs store skips view creation, the initial refresh, and the periodic refresher entirely. matViewsReady stays false, so dashboard queries fall back to the raw tables, and the runtime self-heal path cannot re-arm maintenance since it only triggers from matview-path queries. * fix: guard matview self-heal when maintenance is disabled Review follow-up: carry the resolved disabled state onto the store so triggerMatViewSelfHeal cannot recreate views the configuration says must not exist, and make the schema/docs explicit that a zero duration also disables (positive sub-5s values still clamp up).
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved token parameter compatibility handling to preserve alternative formats when the primary option is unsupported. * **Chores** * Version updated to 2.0.0. * Enhanced load testing configuration for more reliable builds. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## 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 Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## 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 `THIRD_PARTY_NOTICES.md` file to formally document third-party components used in Bifrost that carry license terms requiring explicit attribution — specifically MPL-2.0 licensed dependencies and embedded source code derived from external projects. ## Changes - Introduces `THIRD_PARTY_NOTICES.md` to attribute: - Embedded source code in `framework/migrator/migrator.go` derived from `go-gormigrate/gormigrate` (MIT) - Go binary dependencies carrying MPL-2.0 terms: `github.com/cyphar/filepath-securejoin` and `github.com/hashicorp/go-version` - npm build-time devDependencies carrying MPL-2.0 terms: `lightningcss` (never shipped to end users) and `dompurify` (Apache-2.0 option elected) - All MPL-2.0 components are used unmodified and combined as a "Larger Work" per MPL-2.0 Section 3.3; no Bifrost source files are themselves MPL-licensed. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [x] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [x] Docs ## How to test No functional changes — review the file contents to confirm accuracy of license attributions against the listed upstream repositories. ## Breaking changes - [ ] Yes - [x] No ## Related issues N/A ## Security considerations This change has no security implications. It is a legal/compliance attribution document only. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
## Summary Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## 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 Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## 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 Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## 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 Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## 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 Briefly explain the purpose of this PR and the problem it solves. ## Changes - What was changed and why - Any notable design decisions or trade-offs ## 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 Describe the steps to validate this change. Include commands and expected outcomes. ```sh # Core/Transports go version go test ./... # UI cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` If adding new configs or environment variables, document them here. ## Screenshots/Recordings If UI changes, add before/after screenshots or short clips. ## Breaking changes - [ ] Yes - [ ] No If yes, describe impact and migration instructions. ## Related issues Link related issues and discussions. Example: Closes #123 ## Security considerations Note any security implications (auth, secrets, PII, sandboxing, etc.). ## 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 Bumps several Go dependencies to their latest patch/minor versions across all modules in the repository. ## Changes - `github.com/aws/aws-sdk-go-v2/service/s3`: `v1.97.3` → `v1.99.0` - `github.com/aws/aws-sdk-go-v2/config`: `v1.32.11` → `v1.32.14` - `github.com/aws/aws-sdk-go-v2/internal/ini`: `v1.8.5` → `v1.8.6` - `github.com/weaviate/weaviate`: `v1.36.5` → `v1.38.0` - `github.com/buger/jsonparser`: `v1.1.2` → `v1.2.0` - `github.com/go-openapi/spec`: `v0.22.2` → `v0.22.3` - `github.com/google/cel-go`: `v0.28.1` → `v0.29.0` - `github.com/stretchr/objx`: `v0.5.3` added as an indirect dependency ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [x] Chore/CI ## Affected areas - [x] Core (Go) - [x] Transports (HTTP) - [ ] Providers/Integrations - [x] Plugins - [ ] UI (React) - [ ] Docs ## How to test ```sh go test ./... ``` ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations None. All changes are dependency version bumps with no security-sensitive modifications. ## 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
📝 WalkthroughSummary by CodeRabbit
WalkthroughAuthentication middleware now marks bypassed requests. Provider and provider-key handlers reject endpoint URL configuration from those requests with HTTP 403. Tests verify rejection, persistence protection, endpoint classification, and authenticated-session access. OpenAPI documentation describes the new requirements. ChangesEndpoint authentication enforcement
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 `@transports/bifrost-http/handlers/provider_keys.go`:
- Around line 217-219: Allow bypassed updates when the merged endpoint matches
the persisted endpoint, and require genuine authentication only for endpoint
changes. In transports/bifrost-http/handlers/provider_keys.go:217-219, pass
endpoint-change state derived from oldRawKey and mergedKey to
requireGenuineAuthForEndpointChange; in
transports/bifrost-http/handlers/providers.go:505-509, compare nc.BaseURL with
the stored NetworkConfig.BaseURL before rejecting. Add coverage in
transports/bifrost-http/handlers/providers_test.go:197-246 and
transports/bifrost-http/handlers/provider_keys_test.go:500-535 for bypassed
updates preserving the endpoint while changing a non-endpoint field.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2a721476-1c44-4c69-9220-8e1ce9c0ddcf
📒 Files selected for processing (7)
core/schemas/bifrost.godocs/openapi/paths/management/providers.yamltransports/bifrost-http/handlers/middlewares.gotransports/bifrost-http/handlers/provider_keys.gotransports/bifrost-http/handlers/provider_keys_test.gotransports/bifrost-http/handlers/providers.gotransports/bifrost-http/handlers/providers_test.go
| if requireGenuineAuthForEndpointChange(ctx, baseProvider) { | ||
| return | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Allow bypassed updates that do not change an endpoint.
At Line 217, requireGenuineAuthForEndpointChange receives only baseProvider. It rejects every Ollama, SGL, VLLM, or Azure key update during auth bypass. At Line 505, the provider guard similarly rejects every update that retains a non-empty BaseURL.
Compare the persisted endpoint with the merged requested endpoint. Return 403 only when the endpoint value changes. Otherwise, bypassed callers cannot update unrelated fields such as key weight or provider concurrency when a full PUT payload retains an existing endpoint.
transports/bifrost-http/handlers/provider_keys.go#L217-L219: pass endpoint-change state derived fromoldRawKeyandmergedKeyto the guard.transports/bifrost-http/handlers/providers.go#L505-L509: comparenc.BaseURLwith the storedNetworkConfig.BaseURLbefore rejecting.transports/bifrost-http/handlers/providers_test.go#L197-L246: add a bypassed update that preserves the base URL and changes a non-endpoint field.transports/bifrost-http/handlers/provider_keys_test.go#L500-L535: add a bypassed update that preserves the endpoint and changes a non-endpoint field.
Based on PR objectives, endpoint changes require genuine authentication, not unrelated provider configuration updates.
📍 Affects 4 files
transports/bifrost-http/handlers/provider_keys.go#L217-L219(this comment)transports/bifrost-http/handlers/providers.go#L505-L509transports/bifrost-http/handlers/providers_test.go#L197-L246transports/bifrost-http/handlers/provider_keys_test.go#L500-L535
🤖 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 `@transports/bifrost-http/handlers/provider_keys.go` around lines 217 - 219,
Allow bypassed updates when the merged endpoint matches the persisted endpoint,
and require genuine authentication only for endpoint changes. In
transports/bifrost-http/handlers/provider_keys.go:217-219, pass endpoint-change
state derived from oldRawKey and mergedKey to
requireGenuineAuthForEndpointChange; in
transports/bifrost-http/handlers/providers.go:505-509, compare nc.BaseURL with
the stored NetworkConfig.BaseURL before rejecting. Add coverage in
transports/bifrost-http/handlers/providers_test.go:197-246 and
transports/bifrost-http/handlers/provider_keys_test.go:500-535 for bypassed
updates preserving the endpoint while changing a non-endpoint field.
244a01d to
ce1b2a6
Compare

Summary
Fixes a server-side request forgery (SSRF) vulnerability (GHSA-vj9g-7rqh-x2p4) where an unauthenticated caller could exploit the auth middleware's fail-open bypass (triggered when dashboard authentication is disabled or unconfigured) to set arbitrary dial destinations on provider keys (Ollama, SGL, VLLM, Azure) or provider
network_config.base_url, including private/loopback addresses, without any credential check.Changes
BifrostContextKeyAuthBypassedthat the auth middleware sets exclusively when a request is let through the fail-open branch (no credentials checked), distinct fromIsLocalAdminContextKeywhich is also set on genuinely authenticated sessions.isAuthBypassed()helper to read that context key in handlers.providerKeyCarriesEndpointURL()to identify providers whose key config always carries a caller-chosen dial destination (Ollama, SGL, VLLM, Azure).requireGenuineAuthForEndpointChange()guard that returns HTTP 403 when a bypassed caller attempts to set an endpoint URL on those provider key types; applied to both create and update key handlers.addProviderandupdateProviderfornetwork_config.base_url, preventing a bypassed caller from combiningbase_url+allow_private_network: trueto self-authorize an SSRF target pastValidateExternalURL's private-IP check.base_urlvariants for both add and update provider.Type of change
Affected areas
How to test
go test ./transports/bifrost-http/handlers/...Key test cases to verify:
TestCreateProviderKey_RejectsEndpointWhenAuthBypassed— unauthenticated caller cannot create an Ollama key with an arbitrary URL (expects 403, no key persisted).TestUpdateProviderKey_RejectsEndpointWhenAuthBypassed— unauthenticated caller cannot rewrite an existing Ollama key's URL (expects 403, original URL unchanged).TestRequireGenuineAuthForEndpointChange— a genuinely authenticated admin can still set any endpoint URL; non-endpoint-carrying providers (e.g. OpenAI) are never gated.TestAddProvider_RejectsBaseURLWhenAuthBypassed— unauthenticated caller cannot create a provider withbase_url+allow_private_network: true(expects 403, provider not persisted).TestUpdateProvider_RejectsBaseURLWhenAuthBypassed— same for the PUT variant.TestProviderKeyCarriesEndpointURL— confirms exactly which providers are gated.Breaking changes
Genuinely authenticated admin sessions are unaffected. The restriction applies only to the fail-open bypass path.
Related issues
Closes GHSA-vj9g-7rqh-x2p4
Security considerations
This directly addresses an SSRF primitive: when dashboard auth is disabled or unconfigured, the auth middleware previously let all management API requests through with
IsLocalAdminContextKey = true. Handlers that set dial destinations (provider key endpoint URLs, providerbase_url) did not distinguish between a real admin and an unauthenticated network caller. The newBifrostContextKeyAuthBypassedflag allows those specific handlers to require genuine authentication without changing the fail-open behavior for the rest of the management API.Checklist
docs/contributing/README.mdand followed the guidelines