29 Commits

Author SHA1 Message Date
Ryan Willis
da0a6f7fe6 chore: bump node-libcurl for electron 43 and windows arm support [INS-3111] (#10305) 2026-07-28 12:12:56 -04:00
Kent Wang
202911041b feat: Add a new option to disable launch browser automatically for MCP oauth workflow (#10266)
* add a option to disable oauth browser auto launch in mcp

* fix issue
2026-07-27 08:18:12 +00:00
Jack Kavanagh
5ff4186a79 feat(templating): (H1) route user-plugin response hooks through the sandbox (PR 10b) (#10286)
* feat(templating): (H1) in-sandbox response-hook API + marshaling

First increment of PR 10b (response hooks). Adds the sandbox-side machinery to
run a user plugin's response hook, without yet wiring the network adapters:

- __buildResponseApi(resp): faithful ES5 rebuild of plugins/context/response.ts
  getters (status/headers/time, case-insensitive getHeader returning
  string|string[]|null). getBody() bridges to the existing response.getBodyBuffer
  path; getBodyStream() throws (a Node Readable can't cross the sandbox); setBody()
  base64-encodes the bytes over a new response.setBody bridge path (no fs in the
  sandbox) and updates bytesContent locally.
- __invokeHook: for response hooks, attaches context.response and a READ-ONLY
  context.request (matches pluginRequest.init(..., true)), and marshals both the
  request and response back out.
- host-bridge: response.setBody mapped at baseline (models.read, grouped with the
  other response ops) — a bounded write to the host-set bodyPath, matching the
  ungated in-process behavior; not a general fs write.

Unit test drives a response hook that reads status/headers, reads the body via
the bridge, and rewrites it via setBody (asserting the base64 round-trip and the
read-only request). Host runner + adapter integration + e2e are the next increment.

* feat(templating): (H1) route user-plugin response hooks through the sandbox

Wires the response-hook sandbox core into both hook paths so a user plugin's
response hook runs in QuickJS (bundle plugins and the flag-off path unchanged).

- templating-worker-database: runResponseHookInSandbox + the
  plugin.runUserResponseHook handler; the response.setBody bridge handler
  (base64-decode -> fs.writeFileSync) guarded to the responses directory as
  defense in depth (bodyPath is host-set); pickHookResponseFields.
- network-adapter.node.ts (main/CLI): runs the response hook in the sandbox for
  user plugins, merging the returned response fields onto newResponse.
- invoke-method.ts (plugin window): reaches the same runner over the protocol.

E2E: a user plugin response hook rewrites the body via setBody; the echo
response pane shows the rewrite. Flag off it reports ranin-mainprocess (control),
flag on ranin-sandboxed. Completes H1 (request hooks in PR 10a).

* fix(templating): (H1) revive bridged Buffer in response getBody + reject empty setBody

Addresses Copilot review on #10286:
- in-sandbox-bootstrap.ts: context.response.getBody() now revives the JSON-marshaled
  Buffer shape ({ type: 'Buffer', data: [...] }) back into a (shimmed) Buffer, so hooks
  consume it exactly like the in-process response API instead of a plain object.
- templating-worker-database.ts: response.setBody rejects a missing/non-string bodyBase64
  (TypeError) instead of defaulting to '' — a write primitive must not silently truncate
  the body to zero bytes. An empty string stays a valid empty body.
- sandbox-hooks.test.ts: the getBodyBuffer stub now returns the real marshaled Buffer
  shape and the hook decodes with toString('utf8'), exercising the revive end-to-end.
2026-07-24 10:57:40 -04:00
Insomnia
2fcbf833a6 Bump app version to 13.1.0 (#10296) 2026-07-24 09:50:49 +08:00
Bingbing
8a1dc1ef62 perf: rewrite command palette search to eliminate UI freezes and stale results (#10257)
* perf: rewrite command palette search to eliminate UI freezes and stale results

Problems fixed:
- clientLoader blocked navigation on every palette open, freezing the UI during
  full sequential DB scan
- no AbortController: stale searches could overwrite newer results mid-type
- no debounce: every keystroke triggered a full DB traversal immediately
- React Aria's default contains filter re-filtered server-side fuzzy results,
  silently dropping valid matches and making fuzzy work redundant
- no warm baseline: palette started blank until the entire load completed

Changes:
- move fuzzyMatch/fuzzyMatchAll → insomnia-data/common-src/search.ts (shared,
  testable in node)
- move search logic → insomnia-data/node-src/services/helpers/command-search.ts
  - per-request AbortController cancellation via abort(requestId)
  - recursion depth guard (max 20) on request group traversal
  - safeParent() replaces non-null assertions, safe against orphaned documents
- add CommandSearchResult type in insomnia-data/src/command-search-types.ts
- add useCommandSearch hook: 250ms debounce + abort on filter change + warm
  baseline on mount
- add defaultFilter={() => true} to ComboBox, delegating all filtering to the
  service
- delete routes/commands.tsx

* fix

* fix
2026-07-17 01:07:38 +00:00
Jack Kavanagh
3842690f60 feat(templating): vetted npm libraries in the sandbox — uuid + ajv (M3) (#10244) 2026-07-16 12:53:23 +03:00
Bingbing
1a3bed2d77 refactor: update environment service methods and replace database calls with service calls (#10227) 2026-07-09 16:52:42 +08:00
James Gatz
490aa9b917 feat(Git Sync): Git projects can live anywhere on disk (#10155)
* tech_design

* tech-doc

* add directory to git repo model

* tech doc

* tech doc

* use directory picker to select an existing repo to clone from/to

* tech doc

* Open git repo

* tech doc

* Implement Git project local storage features and add e2e tests

* tech doc

* Implement folder opening as Git projects with user trust confirmation

* Add Git credential selection to project creation form and enhance repo file watcher for directory availability

* tech doc

* refactor: clean up code and remove references to GIT_LOCAL_REPOS_DESIGN.md

* fix: handle optional author name in Git credential display

* feat: enhance Git credential handling for local repositories

* feat: enhance Git project folder handling and improve test descriptions

* fix: update Git project mode button copy

Rename 'Clone from URL' to 'Clone from Remote' and 'Open existing
folder' to 'Open local folder'. Update the smoke test selector and a
stale comment accordingly.

* fix: align control heights and styling in Git clone form

Standardize the credential select, author email select, and clone
location box to match the repository/branch comboboxes: shared
--line-height-xs height, consistent label spacing, and input-sized
value text and padding.

* feat: show clone target path and remember last clone folder

Default the clone parent directory to the folder the user last cloned
into, and render the resulting target path middle-truncated with a full
path tooltip via a new MiddleTruncate component.

* fix: reorder and align Open local folder input layout

Move the helper text directly below the Folder label, and align the
folder box and Choose folder button to the shared control height with
middle-truncated path display.

* feat: warn when opening a folder already used by a project

Add a git.checkGitRepoDirectory IPC that resolves the project adopting
a folder. The Open local folder flow checks at folder-pick time and
shows a red, no-background warning below the input offering to open the
existing project, and blocks continuing while the warning is present.

* fix: top-align empty organization view and scroll the full page

Replace the vertically centered grid with a top-aligned, page-scrolling
layout so the new project form no longer jumps when switching project
types and the scrollbar spans the whole pane.

* fix: align project modal to top and match folder description color

Top-align the project modal overlay so it no longer jumps as the form
height changes, and drop the dimmer color override on the Open local
folder helper text so it matches the repository URL field description.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: always use getRepoBaseDir

* fix comment

* delete duplicate code

* fix: test

* test: add Git repository relocation tests

* fix: ensure selection change handler converts key to string

---------

Co-authored-by: Pavlos Koutoglou <pkoutoglou@gmail.com>
Co-authored-by: Curry Yang <163384738+CurryYangxx@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Curry Yang <1019yanglu@gmail.com>
2026-07-08 05:16:54 +03:00
Jack Kavanagh
cc9288c218 feat(templating): QuickJS template-tag sandbox behind a flag, with e2e canary (#10207)
* feat(templating): PoC run plugin template tags in a QuickJS-WASM sandbox

Behind a new `templateTagSandboxEnabled` setting (default off), route plugin
template-tag execution through a QuickJS-WASM sandbox instead of invoking the
plugin's `run()` directly in the main process.

Approach (per PR #10072): bulk-copy render state into the sandbox as JSON,
rebuild the plugin `context` API in pure JS inside the sandbox, and bridge only
async work back to the host via the existing `pluginToMainAPI` handlers.
`node:crypto` is exposed as synchronous host functions so `require('crypto')`
works without a sync/async mismatch.

- templating/sandbox/: quickjs-runtime, marshal, host-bridge, in-sandbox-bootstrap,
  plugin-tag-sandbox (+ parity tests vs in-process tags and node:crypto)
- main/templating-worker-database.ts: route execute handlers through the sandbox
  when the flag is on; legacy path unchanged otherwise
- esbuild: keep quickjs-emscripten external so its .wasm resolves at runtime
- settings + scripting-settings UI toggle
- examples/insomnia-plugin-sandbox-demo: manual E2E fixture

Scope: template tags only; sandbox runs in main. require shim covers path + crypto
(other modules throw a clear error — follow-up work).

* test(smoke): e2e canary for the template-tag sandbox flag

Installs an inline probe plugin, renders its tags via the tag editor Live
Preview, and asserts the execution path flips main-process -> sandbox when
templateTagSandboxEnabled is toggled in Preferences > Scripting, with a
require('crypto') sha256 workload staying byte-identical across both paths.

* test(sandbox): suppress hardcoded-hmac-key semgrep finding on parity fixture

The HMAC key is a test vector for sandbox-vs-node:crypto parity, not a
credential; rename it to make that self-evident and add the repo-standard
nosemgrep suppression.

* fix(templating): contain sandbox plugin entry resolution to the plugin directory

Reject a package.json "main" that resolves outside the plugin's own folder
and bundled-plugin names that look like paths, so the sandbox source loader
cannot be steered into reading arbitrary files.

* fix(review): inline nosemgrep placement, plugin-load error context, cross-arch-safe canary

- Move the hardcoded-hmac-key suppression onto the flagged line (line-above
  placement was not honored by the scanner).
- Wrap getPluginEntrySource failures with the plugin name for diagnosability.
- Derive the canary's expected arch from the Electron main process instead of
  the Playwright runner so cross-arch setups can't flake the assertion.

* sec(templating): QuickJS template-tag sandbox additions  (#10209)

* fix(sandbox): enforce timeout on synchronous plugin loops

QuickJS's executePendingJobs() blocks the host thread until a synchronous
call returns, so the wall-clock deadline in drivePromiseToString was never
checked during a tight sync loop in plugin code, hanging the Electron main
process indefinitely. Add a QuickJS interrupt handler, which is polled
during synchronous execution, to enforce the deadline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sandbox): clamp crypto.randomBytes size to prevent OOM

hostCrypto.randomBytes(size) passed the sandboxed number straight to
Node's crypto.randomBytes with no upper bound, letting a plugin request
a multi-GB allocation (e.g. crypto.randomBytes(2 ** 31)) and crash the
host process. Clamp to 64KB before the call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sandbox): cap QuickJS heap to prevent unbounded allocation

QuickJS.newContext() had no memory limit, so a plugin allocating without
bound could exhaust the WASM heap and crash the host process. Set a 32MB
ceiling via ctx.runtime.setMemoryLimit().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sandbox): resolve symlinks before validating plugin entry path

getPluginEntrySource's containment check compared raw path strings, so a
plugin directory with a symlinked entry (e.g. index.js -> ../../../etc/secret)
passed the check while fs.readFileSync followed the symlink and read the
out-of-directory target. Re-run the check against fs.realpathSync'd paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sandbox): close util.render sandbox escape

context.util.render() bridged to the shared render() pipeline, whose Liquid
engine dispatches any registered tag's real run() directly, in-process,
regardless of templateTagSandboxEnabled. A sandboxed plugin could hand it a
string containing "{% anyTag %}" (including its own tag) and have that tag
execute completely unsandboxed. Verified with a PoC that reached
child_process execution from inside a plugin tag with no require() or Node
access.

util.render is now restricted to plain {{ variable }} interpolation (the
only real existing use, confirmed against all built-in tag call sites) via
a second Liquid engine with no tags registered; {% tag %} syntax now fails
to parse instead of dispatching. Default render() behavior is unchanged for
every other caller.

Also drops the dead renderDepth field's misleading doc comment: within one
sandboxed execution the envelope's renderDepth is always 0, so depth could
never exceed 1 regardless of enforcement — it couldn't have caught this
recursion anyway.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(sandbox): fixed linting issue

* fix(sandbox): fixed linting issue

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: kwburns-kong <kyle.burns@konghq.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-06 19:01:48 +00:00
Ryan Willis
9d6d712c8b feat: improve collection runner feedback (#10193) 2026-07-06 18:27:40 +02:00
Alison Sabuwala
b43b56c38b feat: move to v3 spaces from v1 organizations call (#10185) 2026-07-06 12:01:20 -04:00
Kent Wang
c57ccdddf1 feat: Sidebar shortcut to create workspace and request (#10189)
* initial check-in to refine sidebars

* fix issues from comment and support init settings model migration for hotkeys

* fix type failure
2026-07-06 07:51:50 +00:00
Bingbing
b58d44ddf8 refactor: migrate workspace-related database calls to services (#10200)
* refactor: migrate workspace-related database calls to services

* optimize
2026-07-03 20:20:00 +02:00
Bingbing
7b8ccd751d refactor: refactor project related database calls to services (#10104) 2026-06-30 10:14:53 +00:00
James Gatz
291dd5f13e feat: add native git credential provider and update related components (#10027)
* feat: add native git credential provider and update related components

- Introduced a new NativeGitCredential type to support system git credential manager.
- Updated GitCredentials model to include native provider type.
- Implemented NativeProvider class to handle authentication via OS git credential manager.
- Refactored git service and utils to accommodate new repoPath parameter for native credentials.
- Enhanced UI components to support native credential setup and display.
- Updated migrations to ensure native credential singleton exists on startup.
- Adjusted various components to handle optional chaining for author fields.

* feat: enhance git credential migration and improve native provider path handling

* fixup: address feedback

* fix spawn error pipe on windows

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor: update import path for GitCredentials type in NativeProvider

* feat: update project page to explicitly select custom Git credentials during project creation

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-30 16:38:55 +08:00
Ryan Willis
a09339b2ac feat: surface more errors in console tab (#10186) 2026-06-30 10:33:38 +08:00
Pavlos Koutoglou
fd6ad6079a fix(git-sync): simplify repo URL entry and remove credential base URL requirement [INS-2124] (#10119)
* Added utils for git

* Remove base url input

* Remove base URL from credentials

* Modify git repo url

* Fix tests
2026-06-24 10:04:43 -07:00
Ryan Willis
a8b5cf81c4 fix: deep-link MCP handling [INS-2631] (#10142) 2026-06-23 14:01:56 -04:00
Alison Sabuwala
72ef5cf563 feat: align list and onboarding UX to unified space model (#10033) 2026-06-23 12:46:14 -04:00
Shelby
86d837d888 feat: add additional konnect analytics event properties (#10137) 2026-06-23 16:13:52 +00:00
Shelby
d4d3c25f12 fix: konnect multi region support (#10125) 2026-06-22 12:24:13 -04:00
Ryan Willis
4d84aea5ad fix: ignore property order fields unless set (#10084) 2026-06-16 20:20:26 +02:00
Ryan Willis
feb24e8644 fix: support variables in websocket requests (#10067) 2026-06-16 16:44:47 +00:00
Kent Wang
778f3c16db fix: Unexpected disableUserAgentHeader field occur in cloud sync (#10089)
* fix unexpected disableUserAgentHeader in cloud sync

* fix type issue
2026-06-16 13:29:39 +08:00
yaoweiprc
5c08a0383c Improve Konnect sync UX [INS-2697] (#10038)
* Close konnect configure modal after validating PAT.

* Remove unused file

* refactor: update delete/remove terminology for projects and workspaces based on konnect control plane presence

* Prevent users from changing the sync type for konnect projects

* Show Konnect tab when their are no projects under org.

* tmp

* Only create necessary konnect proxy env vars (#10005)

* Apply icons for konnect projects

* fix: remove Buffer class usage in renderer code (#10031)

* Streamline workspace create & settings form [INS-2621] (#9940)

* fix: skip file name collision validation when file name is unchanged

The validate callback parameter shadowed the outer `fileName` variable
(which holds the original name with extension). The folder-children
filter compared against the bare input value instead of the full
`fileName`, so the current file was never excluded — causing a false
"already exists" error whenever only the workspace name was edited.

Renaming the parameter to `inputValue` restores access to the outer
`fileName` so the filter correctly excludes the existing file before
checking for collisions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: make .yaml extension shift with input text in workspace settings

The invisible sizer span that drives the CSS grid column width had
static content (the initial filename), so the column never resized
as the user typed and the .yaml suffix stayed at a fixed position.

Switching the TextField to controlled mode (value + onChange) lets
the sizer span reflect the live input value, causing the .yaml label
to follow the text as characters are added or removed. Also removed
the excess pr-7 right-padding since the extension is now positioned
by the grid rather than by padding offset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: allow workspace filename input to adapt down to zero width inputs

* fix: sanitize file name value in workspace settings modal

Apply safeToUseInsomniaFileName to the TextField value prop so the
displayed and submitted value is always sanitized, matching the pattern
used in new-workspace-modal. Previously the controlled value reflected
raw input directly, bypassing character replacement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: minor right padding correction for consistency between new/edit workspace settings filename input

* fix: remove unnecessary w-min from new workspace modal as well

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: enhance konnect sync UX with tooltip for last synced time

* feat: enhance konnect sync UX by navigating to the first project after sync

* feat: add onboarding modal for Konnect environment setup after first sync

* feat: refactor getKonnectDeploymentType for improved control plane type handling

* Fix flaky Konnect smoke test sync assertion

* Update packages/insomnia/src/ui/components/sidebar/project-navigation-sidebar/konnect-env-onboarding.tsx

Co-authored-by: Missy Turco <60163079+mcturco@users.noreply.github.com>

* Update packages/insomnia/src/ui/components/sidebar/project-navigation-sidebar/konnect-env-onboarding.tsx

Co-authored-by: Missy Turco <60163079+mcturco@users.noreply.github.com>

* refactor: remove click and escape handlers from KonnectEnvOnboarding component

* fix: remove unnecessary filter for proxy defaults in upsertProjectEnvVars function

* Keep in Konnect tab after deleting konnect projects.

* Fix Konnect proxy env var creation on sync

* Add Kubernetes Ingress Controller SVG icon to project navigation sidebar

* feat: add k8sIngressController deployment type and corresponding icon

- Updated getKonnectDeploymentType to return 'k8sIngressController' for K8SIngressController control plane type.
- Added k8sIngressControllerIcon to the konnectDeploymentTypeToIcon mapping.
- Fixed the path for serverless.svg and added a new serverless.svg file with the appropriate SVG content.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor: replace database queries with services for project listing and deletion

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor: update control plane configuration to enforce cloud_gateway property and improve deployment type handling

* fix: memoize createInProjectActionList to prevent DOM detachment in menu

* fix: remove proxy defaults check in upsertProjectEnvVars function

* fix: update sync logic to handle environment onboarding and navigation for first successful sync

* fix: add LastSyncedLabel component for improved sync status display

* fix: simplify active tab update logic in project navigation sidebar

* fix: update environment variable mapping tests for proxy vars handling

---------

Co-authored-by: Ryan Willis <ryan.willis@konghq.com>
Co-authored-by: Vivek Thuravupala <2700229+godfrzero@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Missy Turco <60163079+mcturco@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-11 10:17:42 +00:00
Ryan Willis
4bc34bba99 fix: remove Buffer class usage in renderer code (#10031) 2026-06-05 08:50:13 -07:00
Ryan Willis
b819572458 feat: user-agent default handling for v13 (#10015) 2026-06-04 13:15:39 -04:00
yaoweiprc
26020af109 Fix inherited folder auth not applied correctly for OAuth2 requests [INS-2671] (#9999)
* tmp

* Fix the bug that inherited auth is not applied as expected

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add regression coverage for folder auth inheritance precedence (#10000)

* Initial plan

* test: add auth inheritance regression coverage

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-06-02 10:04:51 +00:00
Bingbing
b09cde814d refactor: extract insomnia-data into workspace package (#10010)
Move insomnia-data models, services, database code, and common utilities into a dedicated workspace package. Update consumers to import from the new package entrypoints and declare workspace dependencies for the extracted package.
2026-06-02 09:49:10 +00:00