Repository navigation
fix(providers): let a dashboard OFF for private provider URLs beat the env opt-in - #13323
Merged
diegosouzapw merged 2 commits intoSep 17, 2026
Conversation
…e env opt-in arePrivateProviderUrlsAllowed() says the DB override takes precedence, but it only acted on an override of "true". With the toggle switched OFF in the dashboard and OMNIROUTE_ALLOW_PRIVATE_PROVIDER_URLS=true in the environment (the .env.example opt-in), it fell through to the env check and returned true. The provider guards stayed at "none" while the Feature Flags page showed the flag off with source "db". Read the override directly and treat any stored value as final for this flag, as areLocalProviderUrlsAllowed() already does for its sibling. With no override the env opt-in applies as before, and the legacy OUTBOUND_SSRF_GUARD_ENABLED=false hatch is unchanged.
Owner
|
Confirmed and reproduced: |
This was referenced Sep 19, 2026
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…e env opt-in (diegosouzapw#13323) Confirmed on the tip: `src/shared/network/outboundUrlGuardPolicy.ts` only checked `isTrueValue(dbValue)`, so an explicit dashboard OFF fell through to the env opt-in instead of overriding it — the operator turning something off in the UI had no effect. Probe on your head: 7/7 pass. Thanks, @datrixlab — an explicit OFF in the UI losing to an env var is the kind of thing that erodes trust in the whole settings surface. **Batch validation** — boarded with the other 10 PRs of your batch into one worktree cut from `release/v3.8.51`; every PR verified as an ancestor of the combined HEAD before validating. - Focused tests across all 11 PRs: **104/104 pass** on the combined tree. - Gates on the combined tree: `check-changelog-integrity` PASS, `check-complexity` PASS, `check-cognitive-complexity` PASS, `typecheck:core` PASS, `check:open-sse-typecheck` PASS. - `check-file-size` is red, but reproduces with byte-identical line counts on the pure `release/v3.8.51` tip (`open-sse/handlers/imageGeneration.ts` 3304, `open-sse/services/combo/roundRobinCombo.ts` 1221, `open-sse/utils/stream.ts` 3115). Inherited base-red, nothing added by this batch — it is also why this PR's "Fast Quality Gates" check was red.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arePrivateProviderUrlsAllowed()opens with "DB override takes precedence — it represents an explicit user toggle in the dashboard", but it only acts on an override of"true". An override of"false"falls through to theprocess.envcheck.OMNIROUTE_ALLOW_PRIVATE_PROVIDER_URLS=truein the environment (the opt-in.env.exampledescribes), switching "Allow Private Provider URLs" OFF in the dashboard has no effect:"none", which means no checks at all.db.areLocalProviderUrlsAllowed()in the same file already does this (if (dbValue !== undefined && dbValue !== "") return isTrueValue(dbValue);).truetruefalsetruefalsetruefalsegetProviderValidationGuard()→block-metadata)Related Issues
Validation
outboundUrlGuardPolicy(feature-flag, local-flag, provider validation SSRF guard, provider models LAN guard, remote image fetch, webhook metadata / private opt-in, production build module integrity) pluscc-compatible-provider.test.ts: 63/63 passeslintandprettier --checkon the changed filesrelease/v3.8.51Tests Added Or Updated
tests/unit/outbound-url-guard-feature-flag.test.ts"false"with env"true"→ not allowed, and the validation guard falls back toblock-metadata."false"does not change the legacyOUTBOUND_SSRF_GUARD_ENABLED=falsehatch."false"for the siblingOMNIROUTE_ALLOW_LOCAL_PROVIDER_URLSstill yieldspublic-only. The existing local-flag tests only set that flag throughprocess.env, so a DB-side regression there went unseen (itsresolveFeatureFlag()call sits inside atry/catchthat would swallow a failure).With the source change reverted, the first test fails and the guards and the four existing tests pass.
Coverage Notes
src/shared/network/outboundUrlGuardPolicy.ts: all four branches of the new override/env block are exercised by the seven tests in that file.Reviewer Notes
OUTBOUND_SSRF_GUARD_ENABLED=falsehatch is intentionally left as it was. It is a different key, and whether a dashboard OFF for this flag should also override a globally disabled guard is a separate decision. Relatedly, the "SSRF Guard" flag (OUTBOUND_SSRF_GUARD_ENABLED) is only ever read fromprocess.envhere, so its own dashboard toggle does nothing. That one fails closed, so I left it out of this PR.getFeatureFlagOverridefrom@/lib/db/featureFlags.@/shared/utils/featureFlagsalready imported it, so the dependency graph is the same, and fix(providers): OpenCode Free models do not appear in Combo Builder on Windows #7682's CLI split is unaffected.