Skip to content

fix: private network toggle in custom provider form - #4160

Merged
akshaydeo merged 1 commit into
devfrom
06-08-fix_private_network_toggle_in_custom_provider_form
Jun 9, 2026
Merged

fix: private network toggle in custom provider form#4160
akshaydeo merged 1 commit into
devfrom
06-08-fix_private_network_toggle_in_custom_provider_form

Conversation

@TejasGhatte

@TejasGhatte TejasGhatte commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an "Allow Private Network" toggle to the custom provider creation form, enabling users to configure whether a custom provider can connect to private network IP ranges (e.g., 192.168.x.x, 10.x.x.x). Link-local addresses remain blocked regardless of this setting.

Changes

  • Added allow_private_network as an optional boolean field to the custom provider form schema, defaulting to false
  • Wired the field value into network_config.allow_private_network when saving the provider
  • Added a labeled toggle switch in the form UI with a description clarifying which address ranges are affected and which remain blocked

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

  1. Navigate to the custom provider creation sheet in the workspace providers UI.
  2. Verify the "Allow Private Network" toggle is visible and defaults to off.
  3. Enable the toggle and save the provider — confirm allow_private_network: true is included in the saved network_config.
  4. Disable the toggle and save — confirm allow_private_network: false is sent.
  5. Verify the toggle is disabled when the user lacks provider create access.
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

Add before/after screenshots of the custom provider form showing the new toggle.

Breaking changes

  • Yes
  • No

Related issues

Link related issues and discussions. Example: Closes #123

Security considerations

This toggle explicitly opts a custom provider into connecting to private network ranges. It defaults to false (blocked), preserving the existing secure-by-default behavior. Link-local addresses remain blocked unconditionally to prevent SSRF via metadata endpoints.

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 by CodeRabbit

  • New Features
    • Added an "Allow Private Network" toggle option in the custom provider creation form, enabling users to control private network access settings when setting up custom providers.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jun 8, 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: ASSERTIVE

Plan: Pro

Run ID: 7170229c-c4b5-49bf-9b59-95edda7baf60

📥 Commits

Reviewing files that changed from the base of the PR and between 1f442a7 and 735f72b.

📒 Files selected for processing (1)
  • ui/app/workspace/providers/dialogs/addNewCustomProviderSheet.tsx

📝 Walkthrough

Walkthrough

A new allow_private_network boolean field is added to the custom provider creation form. The field is defined in the form schema, initialized with a default value of false, mapped into the network_config submission payload, and rendered as a user-facing toggle switch in the form UI.

Changes

Private Network Field Addition

Layer / File(s) Summary
Private network field definition and submission
ui/app/workspace/providers/dialogs/addNewCustomProviderSheet.tsx
Form schema includes optional allow_private_network boolean; form defaults initialize it to false; submit handler maps the field into network_config payload with fallback to false when unset.
Allow Private Network toggle switch
ui/app/workspace/providers/dialogs/addNewCustomProviderSheet.tsx
New form control renders an "Allow Private Network" toggle switch wired to the form field, disabled when the user lacks create access.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A network field hops into the form,
Zod schemas and toggles, all clean and warm—
Private paths now shine in the UI's glow,
One little boolean, watching traffic flow!

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR changes do not address the Files API Support requirements from issue #123, which requires file upload endpoints and provider integration features. Either address the Files API Support requirements from #123 or remove/clarify the issue link if this PR is unrelated to that objective.
Out of Scope Changes check ⚠️ Warning The PR adds a private network toggle to the custom provider form, which is out of scope relative to the linked issue #123 requesting Files API Support for providers. Clarify the relationship between this PR and #123, or update the linked issues to reflect that this PR addresses a different requirement.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: private network toggle in custom provider form' is descriptive and specific, clearly summarizing the main change of adding a toggle for private network access in the custom provider form.
Description check ✅ Passed The PR description covers all major template sections: summary, changes, type of change, affected areas, testing steps, security considerations, and checklist items, though screenshots are noted as pending.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-08-fix_private_network_toggle_in_custom_provider_form

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

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@TejasGhatte
TejasGhatte marked this pull request as ready for review June 8, 2026 11:39
@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

Safe to merge — the toggle defaults to off, the RBAC guard is applied, and all form wiring is correct.

The change is small and well-scoped. The only issue is a minor type-safety gap in the Switch checked prop that mirrors the existing is_key_less field and is practically neutralized by the explicit false default value.

No files require special attention beyond the single changed component.

Important Files Changed

Filename Overview
ui/app/workspace/providers/dialogs/addNewCustomProviderSheet.tsx Adds allow_private_network toggle to the custom provider form — schema, default, payload, and UI are all wired correctly; minor type-safety gap with checked={field.value} where the value is `boolean

Reviews (1): Last reviewed commit: "fix: private network toggle in custom pr..." | Re-trigger Greptile

Comment thread ui/app/workspace/providers/dialogs/addNewCustomProviderSheet.tsx

akshaydeo commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jun 9, 6:22 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 9, 6:23 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit fed162e into dev Jun 9, 2026
15 of 16 checks passed
@akshaydeo
akshaydeo deleted the 06-08-fix_private_network_toggle_in_custom_provider_form branch June 9, 2026 06:23
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.

Files API Support

3 participants