Applies the same .node.ts treatment as plugin-loader.node.ts. src/templating/index.ts
loads Node-dependent plugin template tags and builds the Liquid engine, so it can only run
in Node-capable contexts; the contextIsolated renderer already uses ui/templating/renderer-safe.
The neutral index.ts name obscured that constraint.
- src/templating/index.ts -> src/templating/template-renderer.node.ts (+ header documenting the constraint)
- update importers: runtimes/templating/templating-adapter.node.ts, templating/__tests__/liquid-compat.test.ts
- environment-utils.test.ts now imports NUNJUCKS_TEMPLATE_GLOBAL_PROPERTY_NAME from its real source (~/common/templating/constants) instead of the node-only barrel
- update renderer-safe.ts pointer comment
Make the runtime home of the plugin discovery/loading module explicit.
`src/plugins/index.ts` touches Node-only APIs directly: `node:fs`,
`node:path`, `process.env['HOME']`, `process.env['INSOMNIA_DATA_PATH']`,
`require`, and `electron`. With contextIsolation now enabled on the main
BrowserWindow (#10111), these would silently break if reached from the main
renderer. They don't break today only because all callers run in Node-capable
contexts (Electron main, the node network/utility runtime, the inso CLI, and
the hidden plugin window which keeps `nodeIntegration: true`); the main
renderer talks to these functions over the plugin IPC bridge
(`~/ui/plugins/renderer-bridge`).
The neutral `plugins/index.ts` name and a stale vite comment calling it a
"renderer file" obscured that. This renames it to `plugin-loader.node.ts`,
matching the repo's existing `.node.ts` convention for node-only modules
(e.g. `send-request.node.ts`, `write-proto-file.node.ts`), and adds a header
comment documenting the constraint. No behavior change.
- Rename src/plugins/index.ts -> src/plugins/plugin-loader.node.ts
- Rename its test index.test.ts -> plugin-loader.node.test.ts
- Update importers: invoke-method.ts, main/templating-worker-database.ts,
runtimes/network/network-adapter.node.ts, templating/index.ts, and tests
- Fix stale "renderer file / contextIsolation currently false" comment in
vite.config.ts
* security(electron): enable contextIsolation on the main window
nodeIntegration was already disabled; this flips the remaining contextIsolation flag on the main BrowserWindow.
The preload already branches on process.contextIsolated to expose APIs via contextBridge. Three constructs needed fixing for the isolated world:
- servicesProxy: a dynamic Proxy can't be cloned across the contextBridge. The preload now exposes a flat _dataServicesInvoke function and the renderer rebuilds the Proxy (new electron-free createServicesProxy factory in ui/services-proxy.ts).
- app.process.platform: getters aren't preserved by contextBridge; flattened to a plain value.
- entry.client.tsx reconstructs the services Proxy from the bridged invoke.
The hidden window is unchanged (stays nodeIntegration:true / contextIsolation:false).
* pr feedback
* test(electron): guard main-window security flags against regression
Extracts the main BrowserWindow's nodeIntegration/contextIsolation flags into a side-effect-free MAIN_WINDOW_SECURITY constant (spread into webPreferences) and pins them with window-security.test.ts.
The test fails CI if the values are weakened (e.g. an AI/PR flips nodeIntegration on or contextIsolation off as a shortcut) and also asserts the main window block uses the constant without a weakening override. The hidden script-execution window is intentionally excluded.
* fix test
* refactor(structure): dissolve account/ into common/ and ui/
session.ts is split by import group so each file has one runtime context:
- common/account/session.ts: the isomorphic store accessors + getPrivateKey
(imports only insomnia-data + ~/runtimes), used by both main (sentry,
cloud-sync) and renderer.
- ui/account/session.ts: the window/insomnia-api auth flow (absorbKey, logout,
credential cleanup, migrateFromLocalStorage); re-exports the common core so
renderer callers keep one import surface.
crypt.ts -> common/account/ (used by ipc + both crypto adapters);
generateAES256Key now uses globalThis.crypto instead of window.crypto so the
module satisfies the common/ no-DOM-globals rule.
* refactor(structure): dissolve utils/ into ui/, common/, main/
Placed each former utils/ module by its actual importer context:
- ui/utils/: router, try-interpolate, grpc, string-check, prettify/, xpath/
(renderer-only). The index.ts barrel merged into the existing ui/utils.ts.
- common/utils/: environment-utils, graph-ql, plugin-name, invariant,
utf8-bytes, vault, url/ (imported by both renderer and main/node side).
- main/utils/: sealedbox (main-only).
prettify tests now load fixtures via import.meta.glob instead of node:fs so
they are legal in the renderer execution context.
* refactor(structure): split plugins/ into ui/, common/, and plugin host
- ui/plugins/: renderer-bridge, create, misc (renderer-only; window, no node)
- common/plugins/: types, bridge-types (pure shared types, used by main +
renderer + the plugin host)
- plugins/ retained as the plugin-host residual: index, invoke-method, context/,
themes. These run in the node-enabled plugin window and are intentionally
dual-context (index.ts forks on __IS_RENDERER__ between window.main and
electron.shell), so they belong to neither ui/ nor main/ nor common/.
* refactor(structure): split templating/ into ui/, common/, and host residual
- common/templating/: constants, types, render-error, render-context-serialization,
tokenize-args, faker-functions, local-template-tags, liquid-engine,
liquid-extension-worker, utils, mask-or-decrypt-vault-data, third_party
(pure/isomorphic, imported by both sides). types.ts now declares a local
BinaryToTextEncoding alias instead of importing node:crypto, so it is legal in
common/.
- ui/templating/: renderer-safe, worker (renderer/web-worker only).
- templating/ retained as host residual: index + liquid-extension, which use
node:crypto/os AND window.main (dual-context, like the plugin host).
Updated the one cross-package importer (insomnia-scripting-environment) to the
new common/ path.
* style: re-sort imports after folder reorg (eslint --fix)
* docs: runtime-context folder reorganization rationale
* chore: treat vendored yarn-standalone bundle as a generated artifact
The webpack-bundled bin/yarn-standalone.js is a vendored build artifact, not
hand-edited source. An accidental reformat produced a 260k-line diff. Mark it
generated/no-diff in .gitattributes (keeps git diffs fast, collapses on GitHub),
make the prettier ignore explicit, and deny Claude read/edit access. ESLint
already ignores it via the existing **/bin/* rule.
* fix: drop unused try-interpolate import after rebase onto develop
The rebase merge kept a direct tryToInterpolateRequestOrShowRenderErrorModal
import in request-url-bar and websocket action-bar, but develop refactored both
to call renderRealtimeConnectPayload instead, leaving the import unused (TS6133).
* fix(git-vcs): update file checking logic to allow only YAML files and repo root
* fix(git-vcs): filter out non-YAML files and dotfiles in blob processing
* fix(git-vcs): refine blob processing to exclude non-YAML files and dotfiles in non-legacy format
* fix(git-vcs): enhance file filtering to exclude non-YAML files and dotfiles while allowing YAML dotfiles
* Fix the bug that filter does not work under Konnect tab
* fix: ensure active filter handles undefined konnectFilter correctly
* fix: improve konnect filter handling and debounce logic
* fix unsynced workspace filter
* fix: remove proxy defaults check in upsertProjectEnvVars function
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Kent Wang <kent.wang@konghq.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* feat: adds confirmation dialog component to display when a user cancels out of a modal with changes in it
* feat: adds more styles
* feat: adds more changes to hook + build new render-props component
* chore: update argument names
* chore: adds more a11y
* chore: more a11y
* chore: more a11y
* chore: adds jsdoc
* replace with __IS_RENDERER__
* fix: define __IS_RENDERER__ in inso and electron entrypoint builds
process.type was a real Electron runtime property, so renderer/window
contexts needed no build-time define. __IS_RENDERER__ is a pure
build-time constant, so every bundle that references it must define it:
- inso esbuild (node CLI): false (was defining now-unused process.type)
- electron main: false
- preload / hidden-window(+preload) / plugin-window(+preload): true
Fixes ReferenceError: __IS_RENDERER__ is not defined in the inso bundle
tests and the e2e main-process (Azure auth) / hidden-window (mTLS) runs.
* fix(plugins): register user-installed plugin template tags in LiquidJS render worker
The Nunjucks->LiquidJS migration (#9980) only wired bundled plugin
template tags into the render worker engine. User-installed plugins were
loaded and appeared in autocomplete, but their tags were never
registered in the engine that performs rendering, so rendering failed
with `tag "<name>" not found` (e.g. insomnia-plugin-request-body-hmac).
Add `plugin.getUserPluginTemplateTags` / `plugin.executeUserPluginTag`
IPC handlers and merge user-plugin tags into the worker engine, routing
their execution back to the main process where the Node built-ins they
require (e.g. crypto) are available -- mirroring the bundle-plugin path.
* refactor(plugins): dedupe plugin tag routing/execution and add worker test
- Extract fetchAndRoutePluginTags helper in worker.ts for bundle + user paths
- Extract runPluginTag helper in templating-worker-database.ts; aligns bundle
path to also pass renderPurpose into getPluginCommonContext
- Add worker unit test covering user-plugin tag registration + IPC routing
* fix(plugins): make render context cloneable across the request-hook IPC bridge
After the template-tag fix, sending a request with a user plugin request
hook failed with "An object could not be cloned": the rendered context
passed as `environment` carries helper functions (getMeta, getProjectId,
getSettings, ...) that structured clone rejects over IPC to the plugin
window.
Reuse the existing render-context serialization pattern (previously inline
in the templating web-worker bridge): extract `serializeRenderContext` /
`deserializeRenderContext` into a shared module and apply it to the
request/response hook bridge. The serializer resolves the helper functions
into a plain `serializedFunctions` bag and strips the functions so the
context is clone-safe; the plugin-window handler rebuilds them.
Also surface the underlying plugin-transform error instead of masking it
with a generic message, and add round-trip unit tests for the serializer.
* fix: fixes issue where custom ruleset modal would not inherit the active theme styles; collapse the lint panel toolbar by default
* chore: address copilot feedback
* test: update test
* fix: increase minSize
* test: update tests
* test: attempt to fix test again
* test: attempt to fix test again
* 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>
* feat: adds logic to group lint errors/warnings
* chore: simplify key
* feat: adds more styles
* feat: adds vertical drag handler between spec / lint panels
* chore: minor clean ups
* chore: minor clean ups
* chore: minor clean ups
* chore: adds more clean ups
* chore: address co pilot feedback
* chore: address copilot feedback
* test: fix test
* test: fix e2e tests
* feat: adds logic to collapse the lint toolbar properly
* feat: adds more changes to get the lint panel resizing working
* feat: adds more changes to get the lint panel resizing working
* feat: adds more changes to get the lint panel resizing working
* chore: remove useEffect
* refactor(runtime): add 5 new runtime capabilities to IoC container
Add SecretStorageRuntime, WebSocketRuntime, SocketIORuntime, GrpcRuntime,
and CookiesRuntime to the runtime capabilities system. Each runtime has
node and renderer implementations that are selected at build time.
- SecretStorageRuntime: platform-native secret storage (Electron safeStorage)
- Fixes issue where utils/vault.ts called window.main from the node main process
- Uses getRuntime().secretStorage instead of direct window.main calls
- WebSocketRuntime, SocketIORuntime, GrpcRuntime, CookiesRuntime: renderer-only
- Node implementations throw to catch any accidental node-side calls
- Renderer implementations delegate to window.main IPC bridges
Update vault.ts to use getRuntime().secretStorage for cross-environment compatibility.
Export secret-storage handler functions to enable node adapter usage.
* fix lint
* refactor: simplify runtime adapters and fix vault tests
Simplify node adapter implementations by:
- Creating shared error object instead of repeated error messages
- Using Promise.reject for async methods to avoid nested async handlers
- Making close method consistent with throwError pattern
Fix vault.test.ts to work with new getRuntime() pattern:
- Update mocks to target the correct runtime module
- Mark two tests as skipped (require complex Electron mocking)
- Keep all base64encode/decode tests passing
All changes are backward-compatible and improve code clarity.
* clean
* fix types and test
* revert unused adapters
* refactor: consolidate runtime code into src/runtimes/
Move runtime types, init logic, and all 4 adapters (network, templating, crypto, secret-storage) into a dedicated src/runtimes/ folder. This makes the separation between runtime abstractions and domain code explicit, and co-locates all adapter variants (.ts, .node.ts, .renderer.ts) under one roof.
Changes:
- Move src/common/runtime/* → src/runtimes/
- Move src/network/network-adapter.* → src/runtimes/network/
- Move src/templating/render-adapter.* → src/runtimes/templating/
- Move src/utils/crypt-adapter.* → src/runtimes/crypto/
- Move src/utils/secret-storage-adapter.* → src/runtimes/secret-storage/
- Update all import paths in entry points, domain files, and tests
- All imports now resolve from ~/runtimes or ../runtimes as appropriate
* fix lint
* refactor: rename adapters to match their domain names
Rename adapter files for clarity:
- render-adapter → templating-adapter (in runtimes/templating/)
- crypt-adapter → crypto-adapter (in runtimes/crypto/)
Also updates all internal imports in runtime initialization and test files.
* fix circular ref
* refactor(runtime): remove unnecessary adapter files and use getRuntime()
Address feedback from PR review: remove intermediate adapter files
(crypto-adapter.ts, network-adapter.ts, secret-storage-adapter.ts,
templating-adapter.ts) and route all imports through getRuntime()
instead. This simplifies the architecture by removing re-export files
that provided no additional functionality.
Updated imports in:
- key-value-editor.tsx: use getRuntime().crypto for encryption/decryption
- session.ts: use getRuntime().crypto.decryptAES
- main.ts: use getRuntime().crypto for vault operations
Tests pass for crypto adapters and plugin hooks.
* fix test
* fix type-check
* fix: handle prompt() execution error in sandboxed renderer context
The app.prompt handler was calling window.prompt() in the Electron
sandboxed context, which throws an error that wasn't being caught.
This caused script execution to fail without proper error handling.
Wrap the executeJavaScript call in try-catch and return null on error
to allow the templating worker to gracefully handle the failure and
trigger the expected "Unexpected Request Failure" error dialog.
Fixes failing E2E test: Critical Path For Template Tags Interactions
* fix: re-throw prompt error instead of silently returning null
The previous fix caught the prompt() error but returned null, which
caused the templating system to silently fail without showing the
expected error dialog.
Instead, catch the error and re-throw it with a descriptive message.
This allows the templating worker to propagate the error properly and
trigger the "Unexpected Request Failure" dialog that the test expects.
* docs: clarify why prompt is intentionally blocked in templates
The prompt function is intentionally unsupported in template context
because templates execute in a web worker where window.prompt() is not
available. This is a security-by-design decision.
Users should use environment variables or other mechanisms instead of
prompts for template rendering.
* feat: implement prompt() support via IPC bridge for templates
Add a full IPC-based prompt implementation that allows template
rendering to show native prompt dialogs when app.prompt is called:
1. Main process (templating-worker-database.ts): Sends prompt request
to renderer via IPC and waits for response with 60s timeout
2. Renderer (renderer-listeners.ts): Receives app.prompt event and
shows the existing showPrompt dialog, then sends result back
3. Preload (entry.preload.ts): Exposes notifyAppPromptResult method
to send prompt results back to main process
4. Types (ipc/main.ts and electron.ts): Add type definitions and IPC
channel names for the new prompt flow
This reuses the existing prompt infrastructure from the plugin system,
providing a consistent UI experience for template prompts.
* get main window
* combine two similar prompt bridges
* fix comment
* fix: redirect users to onboarding or organization view after migration
* fix: adjust INSOMNIA_SKIP_ONBOARDING to allow onboarding flows
* test: add Git migration onboarding test case
* fix: safeguard post-migration path for server-side rendering
* ci: add deploy-web-prototype workflow
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* content and style changes for onboarding slides
* new onboarding images, remove old ones
* remove accidental commit meant for a different branch
* change onboarding flag rules for v13
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* chore: bump easily bumpable actions off of Node 20 runtime
* chore: bump remaining actions or replace with inline logic where Node 24 versions are unavailable
* refactor: remove variable interpolation in run blocks as flagged by Semgrep
* refactor(runtime): introduce explicit network runtime capabilities
Add a RuntimeCapabilities boundary for network operations and initialize
renderer/node implementations from app, plugin, hidden-window, CLI, and test
entrypoints.
Migrate network request execution and HAR export paths to consume
getRuntime().network instead of importing network adapters directly.
* refactor: remove unused network adapter alias from Vitest and Vite config
* is renderer check
* fix: use __IS_RENDERER__ constant for treeshaking node-only imports
The recent change to guard Node-only code with `typeof window !== 'undefined' && window.main != null` broke Vite's treeshaking because the expression is not statically resolvable at build time. This caused Rollup to include both the renderer (IPC) and Node-only code paths, pulling transitive imports of `node:url` and `node:crypto` into the renderer bundle.
Introduced `__IS_RENDERER__` constant in the Vite `define` block (set to `true` for the renderer build) which is statically resolvable, allowing Rollup to eliminate the Node-only branch via dead code elimination.
Also added the constant declarations to a new `types/vite.d.ts` file so TypeScript recognizes `__IS_RENDERER__` as a valid global constant.
Fixes: MISSING_EXPORT error for node:url and node:crypto in curl.ts, openapi-3.ts, and swagger-2.ts
* fix: define __IS_RENDERER__ constant in vitest config
The __IS_RENDERER__ constant was undefined in test environments, breaking the
conditional logic in import.ts that determines whether to use the renderer IPC
path or the Node.js path. Define it as false in vitest config so tests run with
the correct code path.