Commit Graph

510 Commits

Author SHA1 Message Date
Jack Kavanagh
7cd8854f24 feat: lift network.ts fs/path behind window.main.timeline IPC bridge (#9945)
* updated plan

* feat: lift network.ts fs/path use behind window.main.timeline IPC bridge

Removes `node:fs` and `node:path` from the renderer-reachable
`src/network/network.ts`. Three timeline-path constructions and two
`appendFile` calls are replaced with narrow `window.main.timeline.getPath`
(sync IPC) and `window.main.timeline.appendToFile` (async IPC) helpers
that live in main, where Node builtins belong.

Path validation in `appendToTimeline` mirrors `writeResponseBodyToFile`:
only paths inside the `responses/` directory ending in `.timeline` are
accepted, preventing a compromised renderer from writing arbitrary files.

Updates `config/renderer-node-import-baseline.json` to remove the two
`src/network/network.ts` entries — the baseline shrinks as intended.

Part of the nodeIntegration: false migration (PR B).

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

* fix: address Aikido path-traversal feedback and mock window.main in network tests

- `getTimelinePath`: use `path.resolve` + `path.relative` check instead of
  `path.join` to prevent path-traversal attacks (Aikido medium severity finding)
- `network.test.ts`: add `vi.stubGlobal('window', ...)` mock for
  `window.main.timeline` so tests don't throw "window is not defined" now
  that `defaultSendActionRuntime` calls `window.main.timeline.appendToFile`

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

* chore: suppress echoServer stdout in playwright config

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

* fix: update insomnia-inso logger for consola v3 compatibility

FancyReporter and BasicReporter were removed in consola v3; LogLevel became
a type-only export and the runtime enum is now LogLevels. Replace with
createConsola + a local BasicReporter shim, and import LogLevels in cli.ts.

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

* refactor: address timeline IPC review concerns

- Convert timeline.getPath from sendSync to invoke (async) to avoid
  blocking the renderer thread; path construction has no I/O
- Extract getResponsesDir() shared helper so both getTimelinePath and
  appendToTimeline read the same source of truth, eliminating env-drift
  between the two calls
- Guard mkdir with a Set so the responses directory is only created once
  per process rather than on every appendFile call

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

* fix: upgrade consola to v3 and fix type/import issues in insomnia-inso

- Bump consola from ^2.15.3 to ^3.4.2 to match logger.ts which already used v3 API (createConsola)
- Fix logType → LogType (renamed in v3)
- Remove fancy option (removed in v3 ConsolaOptions)
- Use ConsolaInstance instead of Consola in result-report.ts so .log() resolves correctly
- Fix import sort in cli.ts

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

* fix: restore Node.js-safe fallbacks in network.ts for inso CLI

The timeline IPC bridge introduced window.main.timeline calls without
guarding against the inso CLI context where window is not defined.
The electron shim (aliased in the inso bundle) provides app.getPath
as a fallback, matching the pre-bridge behaviour.

- getTimelinePath: check typeof window before using IPC; fall back to
  the electron shim path (os.tmpdir()/insomnia-send-request/responses)
- defaultSendActionRuntime.appendTimeline: fall back to fs.promises.appendFile
- tryToExecutePreRequestScript catch block: skip IPC appendToFile in
  Node.js context

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

* fix: sort node: imports before third-party and replace if/else with ternary in network.ts

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

* fix: replace static fs/path imports with inline require() to pass renderer baseline check

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

* refactor: replace process.type branching in network.ts with build-time adapter modules

Eliminates all runtime process.type and typeof window checks by introducing
network-adapter.renderer.ts and network-adapter.node.ts. Vite and Vitest resolve
the import to the renderer adapter; inso esbuild resolves to the node adapter.
No branching code remains in network.ts itself.

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

* fix: restore object alias format in vite.config.ts to fix rollup build

Array-form alias with find:'~' was not matching prefix imports like
~/common/insomnia-fetch in the react-router production build. Object
form behaves correctly in Vite 7.

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

* fix: resolve merge conflicts in logger.ts and cli.ts, restore AGENTS.md indented tree

- logger.ts: keep LogType (consola v3 casing), drop duplicate conflict markers
- cli.ts: remove stashed duplicate LogLevels import from conflict block
- AGENTS.md: restore indented hierarchy in Repository Structure and Data Model sections

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

* remove cx

* fix: add path traversal guard to getTimelinePath in node adapter

Mirrors the same defence-in-depth check already present in the IPC handler.

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

* fix tests which use network from main

* flake

* refactor: replace bundler aliases with process.type runtime detection in network-adapter

Instead of three separate bundler aliases (Vite, esbuild main, esbuild inso),
network-adapter.ts now selects the correct adapter at runtime using
process.type === 'renderer'.

- Vite prod: process.type is already inlined as 'renderer' via define, so
  Rollup tree-shakes the node branch
- esbuild main: define process.type='browser' so esbuild tree-shakes renderer branch
- esbuild inso: define process.type=undefined so esbuild tree-shakes renderer branch
- Vitest (insomnia): existing renderer alias kept for test environment
- Vitest (inso): add renderer alias to match pre-existing test behaviour and
  avoid loading native node-libcurl module in tests

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

* fix: restore vite alias for network-adapter to fix server bundle build

The react-router build produces both client and server bundles. Without
the alias, the server bundle encountered a runtime require() for
'./network-adapter.renderer' that couldn't resolve (Vite inlines
process.type='renderer' via define for the server build too, so Rollup
tree-shakes to the renderer branch, but the module gets externalized in
the server bundle rather than inlined, leaving a broken runtime require).

Restoring the alias ensures both builds inline network-adapter.renderer
directly, which is safe because the module only defines functions —
window.main is never called at module init time.

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

* feedback

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 09:44:48 +00:00
Ryan Willis
461a57e428 chore(analytics): consolidate analytics into shared insomnia-analytics package (#9915) 2026-05-14 10:34:40 -07:00
kwburns-kong
c124a66224 chore: resolve dependency, dead code, and other coding improvements (#9902)
* chore: resolves INS-2472
* fix: resolves INS-2473
* chore: resolves INS-2474
* chore: removed dead code, resolves (INS-2473).
* chore: updated @xmldom/xmldom to 0.9.10.
2026-05-08 21:41:17 +00:00
kwburns-kong
c8bdd6b1b7 chore: Security update for dependencies and github workflows (#9884)
* chore: resolves INS-2457, INS-2458, INS-2459, and INS-2460.
2026-05-01 09:45:33 -07:00
yaoweiprc
7809d458aa Update E2E test for git sync [INS-2258] (#9878)
* Add more test cases for git sync

* tmp

* Update package.json
2026-04-30 15:16:18 +02:00
Jack Kavanagh
92a79e799b Chore: playwright dx v2 (#9876) 2026-04-30 06:42:46 +02:00
yaoweiprc
933f56854e Git server for smoke test [INS-2258] (#9816)
* Git server for smoke test

* Try to solve flaky test

* feat: remove unused Git hook samples and add Credentials tab functionality

- Deleted various sample Git hook scripts from the git-server fixture, including post-update, pre-applypatch, pre-commit, pre-merge-commit, pre-push, pre-rebase, pre-receive, prepare-commit-msg, push-to-checkout, sendemail-validate, and update hooks.
- Introduced a new PreferencesCredentialsTab class to manage Git credentials within the Insomnia Preferences.
- Updated the PreferencesPage to include the new Credentials tab for Git credentials management.
- Enhanced the ProjectPage with a method to create a Git Sync project, including branch creation and switching.
- Added comprehensive tests for Git Sync functionality, including creating branches, committing changes, and merging branches.
- Updated UI components to support new features, including data-testid attributes for better testability.

Co-authored-by: Copilot <copilot@github.com>

* feat: update path import and add Git sync tests

* revert package.json

* Update package.json

* feat: add new dependencies for Git HTTP mock server and related utilities

* refactor: remove commented-out code in addAccessTokenGitCredential function

* fix: update export tests to use toHaveLength for file count assertions

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-28 09:44:54 +00:00
kwburns-kong
f220db351f feat: revamping pre/post scripting sandbox (#9794)
* feat: revamping pre/post scripting sandbox
* feat: added UI setting to enable/disable specific checks
2026-04-27 13:43:18 +00:00
Ryan Willis
ae49df6a57 fix: bump node-libcurl and add ipv6 tests (#9869) 2026-04-24 19:04:02 -07:00
Fares Osman
e7e3148f1b chore: update insomnia-plugin-ai (#9862) 2026-04-24 12:02:05 -04:00
kwburns-kong
b6c222e671 fix: resolves INS-2366 (#9852)
* fix: resolves INS-2366 dependency issues
2026-04-23 10:10:29 +08:00
Alison Sabuwala
d19e58a9f6 feat: integrate v3 user endpoints (#9785)
* feat: integrate v3 user endpoints

* feat: use public sdk for insomnia-api
2026-04-22 10:25:37 -04:00
Jack Kavanagh
4818dd1def refactor: shared browser safe helper cleanup (#9810)
* refactor: shared browser-safe helper cleanup

* style: run eslint autofix

* fix: preserve empty url handling

* fix: address remaining copilot comments on pr3

* remove loader class
2026-04-15 10:41:38 +02:00
Insomnia
b18f9528fc Bump app version to 12.5.1-alpha.0 2026-04-11 00:15:09 +00:00
Vivek Thuravupala
8ac6707321 fix: Use json-bigint for parsing JSON in the response template tag to handle large numbers [#8988] (#9728)
* Use json-bigint for parsing JSON in the response template tag [#8988]

Large numbers can lose precision when parsed using JSON.parse.

* Add unit tests to verify behavior of response template tag when handling large numbers [#8988]

* Add additional tests to cover floating point numbers

* Add inline documentation explaining usage of json-bigint + storeAsString

* Remove bespoke type definition for json-bigint; install existing one
2026-04-06 23:12:10 -07:00
Ryan Willis
52d64a0116 chore(deps): bump dependencies (#9756) 2026-04-03 19:08:00 -04:00
Insomnia
33e0c2e2e2 Bump app version to 12.5.0 2026-04-01 21:51:11 +00:00
Insomnia
8f6bf2af2f Bump app version to 12.5.0-beta.0 2026-03-26 02:32:17 +00:00
Ryan Willis
e6c51d59c1 chore: upgrade to electron 41.0.3 and node 24.14.0 (#9734)
* chore: upgrade to electron 41.0.3 and node 24.14.0
2026-03-24 15:05:41 -07:00
Curry Yang
5cb1a7016a test: e2e test for export (#9652)
* test: export

* update

* test: add more case

* feat: add har format test

* Update packages/insomnia-smoke-test/pages/project.ts

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

* fix: comment

* refactor: adapt to the latest pom structure

* fix

* fix

* fix comment

* Wait for preference modal hidden

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

* Remove duplicate codes

* fix workspace page ui

* fix comment

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-17 14:18:25 +08:00
Insomnia
0e30098049 Bump app version to 12.4.0 2026-03-04 23:55:20 +00:00
Insomnia
a7dbd115f9 Bump app version to 12.4.0-beta.0 2026-02-26 04:11:02 +00:00
Alison Sabuwala
9e29c40d87 feat: add URL backend for custom LLM endpoints (#9640)
* Add support for configuring custom OpenAI-compatible LLM endpoints via URL.
* Includes new URL backend component, backend service updates, unit tests, and
* UI consistency improvements across all LLM configuration components.
2026-02-09 18:36:45 -05:00
Ryan Willis
9c3b6178a4 feat: inso analytics [INS-1834] (#9621)
* feat: inso analytics [INS-1834]

* formatting + circular import fix

* fix: don't lose overrides when memDB contains Settings

* refactor: alleviate circular import additions

* review changes

* reduce refs to db type
2026-02-05 08:12:05 -07:00
Insomnia
58cc102bf8 Bump app version to 12.3.1 2026-02-05 05:24:10 +00:00
Insomnia
5d669097a9 Bump app version to 12.3.1-beta.1 2026-02-04 08:00:05 +00:00
Insomnia
a195fdf6a2 Bump app version to 12.3.1-beta.0 2026-02-02 00:05:36 +00:00
Insomnia
efdc35fd43 Bump app version to 12.3.0 2026-01-15 00:38:36 +00:00
Insomnia
04a1360620 Bump app version to 12.3.0-beta.0 2026-01-08 04:55:57 +00:00
Bingbing
bf4e0fc321 feat: integrate customer-io in-app messages (#9510) 2025-12-26 16:10:38 +08:00
Bingbing
5aad514412 chore: clean unused crypt code and hkdf (#9519) 2025-12-26 14:08:05 +08:00
Kent Wang
01c512ae34 feat: Allow empty credential configs to work with cloud providers (#9499)
* support empty credential config
* update plugin package
* update yaml for fix test error
2025-12-26 10:18:37 +08:00
Bingbing
a4250a53e3 chore: add circular reference check (#9065) 2025-12-23 02:44:40 +00:00
Insomnia
da68781c30 Bump app version to 12.2.0 2025-12-19 00:24:44 +00:00
Insomnia
139791a4fb Bump app version to 12.2.0-beta.1 2025-12-16 19:56:31 +00:00
Kent Wang
64a769bb77 feat: Add sampling support for MCP (#9395)
* squash commits for elicitation support
* add basic mcp support
* update ai plugin version
2025-12-15 16:29:34 +08:00
Insomnia
d0f07bf1d7 Bump app version to 12.2.0-beta.0 2025-12-12 09:15:42 +00:00
Jack Kavanagh
66b39cad4b pin react plugin and autofix (#9458)
* pin react plugin and autofix

* fix type check failure on mcp

* fix issues

---------

Co-authored-by: Kent Wang <kent.wang@konghq.com>
2025-12-11 09:33:15 +00:00
Bingbing
1d625ba1c9 refactor: extract insomnia-api (#9093) 2025-12-08 03:57:47 +00:00
Shelby Moore
66aad51525 chore: remove insomnia-api-client package dep (#9432) 2025-11-27 13:37:27 +00:00
Curry Yang
e43bd82620 feat: base components - [INS-1570] (#9344)
* feat: form component

* feat: use twMerge to support class overide

* Spike: Add markdown format doc support for base-components (#9368)

* initial check-in

* add things

* update select.mdx

* use react live things

* add package-json

* Revert "add package-json"

This reverts commit c57abf6178f39e631ec7fe6634cb4e6afd950fdb.

* update comment

* update docs

* type fix

* tailwind v4 upgrade

* upgrade tailwind v4 in docusaurus

* feat: add more components (#9426)

* update

* update

---------

Co-authored-by: Kent Wang <kent.wang@konghq.com>
2025-11-26 18:37:21 +08:00
Jack Kavanagh
14e44f98a3 Chore/bump-linting-pkgs (#9409)
* bump linting pkgs

* add temporary ignores

* fix test

* autofix
2025-11-25 16:49:03 +00:00
Curry Yang
8f1e3bf22b Chore/tailwind v4 upgrade - [INS-1653] (#9350)
* chore: Tailwind v4 upgrade

* fix: ui issues

* feat: new feature update

* fix: remove debug code

* fix: order

* fix: conflict

* fix: issues
2025-11-24 10:06:51 +00:00
Insomnia
5d4f750b31 Bump app version to 12.1.0 2025-11-21 06:47:53 +00:00
Insomnia
0c640f58c1 Bump app version to 12.1.0-beta.1 2025-11-20 09:58:45 +00:00
Insomnia
1cec82cc26 Bump app version to 12.1.0-beta.0 2025-11-14 08:29:15 +00:00
Shelby Moore
5702140c8d chore: bump ai plugin to 1.0.6 (#9379) 2025-11-13 16:19:30 -08:00
Bingbing
81e4da2380 feat: support ca cert config for mcp (#9376) 2025-11-13 18:04:53 +08:00
Insomnia
2459790050 Bump plugin version to 0.1.3 (#9373) 2025-11-13 11:45:06 +08:00
Shelby Moore
2ba33df3dc chore: bump insomnia-plugin-ai to 1.0.5 (#9370) 2025-11-12 09:44:27 -08:00