Skip to content

Commit 7ccd81f

Browse files
Merge branch 'develop' into 001-tab-autocomplete
2 parents 14437d7 + 3bce64d commit 7ccd81f

24 files changed

+1777
-147
lines changed

.github/workflows/release-build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,42 @@ jobs:
163163
CREDENTIAL_ID: ${{secrets.ES_CREDENTIAL_ID}}
164164
TOTP_SECRET: ${{secrets.ES_TOTP_SECRET}}
165165

166+
- name: Check squirrel exe signature (Windows only)
167+
if: runner.os == 'Windows'
168+
shell: pwsh
169+
run: |
170+
$version = $env:INSO_VERSION
171+
# https://github.com/electron/windows-installer/blob/main/src/index.ts#L25 (convert version to NuGet-compatible)
172+
$nupkgVersion = $version -replace "-([a-zA-Z]+)\.", '-$1'
173+
$nupkg = "insomnia-${nupkgVersion}-full.nupkg"
174+
Write-Host "scan insomnia-${nupkgVersion}-full.nupkg"
175+
7z x "packages/insomnia/dist/squirrel-windows/${nupkg}" -o"${version}-extract"
176+
177+
$exeFiles = Get-ChildItem -Path "${version}-extract/lib/net45" -Filter *.exe
178+
179+
if ($exeFiles.Count -eq 0) {
180+
Write-Warning "No .exe files found in the package"
181+
exit 1
182+
}
183+
184+
Write-Host "Found $($exeFiles.Count) .exe file(s):"
185+
Write-Host ""
186+
187+
foreach ($exe in $exeFiles) {
188+
Write-Host "Checking: $($exe.Name)"
189+
Write-Host " Path: $($exe.FullName)"
190+
$signature = Get-AuthenticodeSignature -FilePath $exe.FullName
191+
Write-Host " Status: $($signature.Status)"
192+
Write-Host " Signer: $($signature.SignerCertificate.Subject)"
193+
Write-Host " Timestamp: $($signature.TimeStamperCertificate.NotAfter)"
194+
if ($signature.Status -ne 'Valid') {
195+
Write-Error " ❌ Invalid signature for $($exe.Name)"
196+
exit 1
197+
}
198+
Write-Host " ✓ Valid signature" -ForegroundColor Green
199+
}
200+
Write-Host "✓ All executables are properly signed" -ForegroundColor Green
201+
166202
- name: Package inso
167203
run: |
168204
echo "Replacing electron binary with node binary"

package-lock.json

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/insomnia-inso/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "insomnia-inso",
4-
"version": "12.0.0",
4+
"version": "12.1.0-beta.0",
55
"homepage": "https://insomnia.rest",
66
"description": "A CLI for Insomnia - The Collaborative API Design Tool",
77
"author": "Kong <[email protected]>",
@@ -65,6 +65,6 @@
6565
"yaml": "^2.7.1"
6666
},
6767
"optionalDependencies": {
68-
"@kong/insomnia-plugin-external-vault": "0.1.1-dev.0.20250902151320"
68+
"@kong/insomnia-plugin-external-vault": "0.1.3"
6969
}
7070
}

packages/insomnia-inso/src/cli.test.ts

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { ExecException } from 'node:child_process';
22
import { exec } from 'node:child_process';
3+
import fs from 'node:fs';
4+
import { tmpdir } from 'node:os';
35
import path from 'node:path';
46

57
import { beforeAll, describe, expect, it } from 'vitest';
@@ -144,8 +146,7 @@ describe('inso dev bundle', () => {
144146
});
145147

146148
it('send request with client cert and key', async () => {
147-
const input =
148-
`$PWD/packages/insomnia-inso/bin/inso run collection -w packages/insomnia-inso/src/db/fixtures/nedb --requestNamePattern "withCertAndCA" --verbose "Insomnia Designer" wrk_0b96eff -f $PWD/packages`;
149+
const input = `$PWD/packages/insomnia-inso/bin/inso run collection -w packages/insomnia-inso/src/db/fixtures/nedb --requestNamePattern "withCertAndCA" --verbose "Insomnia Designer" wrk_0b96eff -f $PWD/packages`;
149150
const result = await runCliFromRoot(input);
150151
if (result.code !== 0) {
151152
console.log(result);
@@ -186,6 +187,69 @@ describe('inso dev bundle', () => {
186187
expect(result.stdout).toContain('updated value from folder: 666');
187188
});
188189
});
190+
191+
describe('run collection report generation', () => {
192+
it.each([
193+
{
194+
name: 'default report',
195+
input:
196+
'$PWD/packages/insomnia-inso/bin/inso run collection -w packages/insomnia-inso/src/examples/run-collection-result-report.yml wrk_c5d5b5 -e env_1072af',
197+
expectedReportFile: './fixtures/run-collection-report/default-report.json',
198+
},
199+
{
200+
name: 'redact report',
201+
input:
202+
'$PWD/packages/insomnia-inso/bin/inso run collection -w packages/insomnia-inso/src/examples/run-collection-result-report.yml wrk_c5d5b5 -e env_1072af --includeFullData=redact --acceptRisk',
203+
expectedReportFile: './fixtures/run-collection-report/redact-report.json',
204+
},
205+
{
206+
name: 'plaintext report',
207+
input:
208+
'$PWD/packages/insomnia-inso/bin/inso run collection -w packages/insomnia-inso/src/examples/run-collection-result-report.yml wrk_c5d5b5 -e env_1072af --includeFullData=plaintext --acceptRisk',
209+
expectedReportFile: './fixtures/run-collection-report/plaintext-report.json',
210+
},
211+
])('generate report: $name', async ({ input, expectedReportFile }) => {
212+
const root = path.join(tmpdir(), 'insomnia-cli-test-output');
213+
const outputFilePath = path.resolve(root, 'run-collection-report-output.json');
214+
215+
const result = await runCliFromRoot(`${input} --output ${outputFilePath}`);
216+
expect(result.code).toBe(0);
217+
218+
const expectedReport = JSON.parse(fs.readFileSync(path.resolve(__dirname, expectedReportFile), 'utf8'));
219+
expect(fs.existsSync(outputFilePath)).toBe(true);
220+
const report = JSON.parse(fs.readFileSync(outputFilePath, 'utf8'));
221+
222+
// Some fields are dynamic so we use expect.any to validate their types/ existence
223+
expect(report).toEqual({
224+
...expectedReport,
225+
executions: expectedReport.executions.map((exec: any) => ({
226+
...exec,
227+
response: {
228+
...exec.response,
229+
// executionTime can vary so just check it's a number
230+
responseTime: expect.any(Number),
231+
headers: exec.response.headers
232+
? {
233+
...exec.response.headers,
234+
date: expect.any(String),
235+
}
236+
: undefined,
237+
},
238+
tests: exec.tests.map((test: any) => ({
239+
...test,
240+
executionTime: expect.any(Number),
241+
})),
242+
})),
243+
timing: {
244+
started: expect.any(Number),
245+
completed: expect.any(Number),
246+
responseAverage: expect.any(Number),
247+
responseMin: expect.any(Number),
248+
responseMax: expect.any(Number),
249+
},
250+
});
251+
});
252+
});
189253
});
190254

191255
const packagedSuccessCodes = shouldReturnSuccessCode.map(x =>

0 commit comments

Comments
 (0)