Skip to content

Commit ee16d6d

Browse files
committed
SDK v4 adds checkMalware() for integrated malware detection.
* fix: migrate getSupportedScanFiles to getSupportedFiles (SDK v4) SDK v4 removed deprecated getSupportedScanFiles(). The replacement getSupportedFiles(orgSlug) requires an org parameter. Updated all type references from getReportSupportedFiles to getSupportedFiles. * fix(tests): update supported files tests for SDK v4 getSupportedFiles(orgSlug) * fix(tests): correct mock path for fetch-default-org-slug (.mjs not .mts) * fix: pass orgSlug to fetchSupportedScanFileNames instead of discovering internally
1 parent f49df6e commit ee16d6d

17 files changed

Lines changed: 39 additions & 39 deletions

packages/cli/scripts/environment-variables.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export class EnvironmentVariables {
5656
}).trim()
5757
} catch {}
5858

59-
// Get external tool versions from external-tools.json.
59+
// Get external tool versions from bundle-tools.json.
6060
const externalTools = JSON.parse(
61-
readFileSync(path.join(rootPath, 'external-tools.json'), 'utf-8'),
61+
readFileSync(path.join(rootPath, 'bundle-tools.json'), 'utf-8'),
6262
)
6363

6464
/**
@@ -68,13 +68,13 @@ export class EnvironmentVariables {
6868
const tool = externalTools[key]
6969
if (!tool) {
7070
throw new Error(
71-
`External tool "${key}" not found in external-tools.json. Please add it to the configuration.`,
71+
`External tool "${key}" not found in bundle-tools.json. Please add it to the configuration.`,
7272
)
7373
}
7474
const value = tool[field]
7575
if (!value) {
7676
throw new Error(
77-
`External tool "${key}" is missing required field "${field}" in external-tools.json.`,
77+
`External tool "${key}" is missing required field "${field}" in bundle-tools.json.`,
7878
)
7979
}
8080
return value
@@ -158,7 +158,7 @@ export class EnvironmentVariables {
158158
static loadSafe() {
159159
try {
160160
const externalTools = JSON.parse(
161-
readFileSync(path.join(rootPath, 'external-tools.json'), 'utf-8'),
161+
readFileSync(path.join(rootPath, 'bundle-tools.json'), 'utf-8'),
162162
)
163163
return {
164164
INLINED_COANA_VERSION:

packages/cli/scripts/sea-build-utils/downloads.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ import { PLATFORM_MAP_TOOLS } from '../constants/external-tools-platforms.mjs'
3535
export const logger = getDefaultLogger()
3636

3737
/**
38-
* External tools configuration loaded from external-tools.json.
38+
* External tools configuration loaded from bundle-tools.json.
3939
* Contains version info, GitHub repos, and download metadata for security tools.
4040
*/
4141
const __dirname = path.dirname(fileURLToPath(import.meta.url))
42-
const externalToolsPath = path.join(__dirname, '../../external-tools.json')
42+
const externalToolsPath = path.join(__dirname, '../../bundle-tools.json')
4343
export const externalTools = JSON.parse(readFileSync(externalToolsPath, 'utf8'))
4444

4545
/**
@@ -251,13 +251,13 @@ export async function downloadExternalTools(platform, arch, isMusl = false) {
251251
}
252252

253253
// Security tool versions and GitHub release info.
254-
// Versions are read from external-tools.json for centralized management.
254+
// Versions are read from bundle-tools.json for centralized management.
255255
// Repository info is derived from the 'repository' field (format: owner/repo).
256256
const TOOL_REPOS = {
257257
__proto__: null,
258258
}
259259

260-
// Populate TOOL_REPOS from external-tools.json.
260+
// Populate TOOL_REPOS from bundle-tools.json.
261261
// Filter by type === 'github-release' to include all GitHub-released tools.
262262
for (const [toolName, toolConfig] of Object.entries(externalTools)) {
263263
if (toolConfig.type === 'github-release') {
@@ -297,11 +297,11 @@ export async function downloadExternalTools(platform, arch, isMusl = false) {
297297
for (const [toolName, assetName] of Object.entries(toolsForPlatform)) {
298298
const config = TOOL_REPOS[toolName]
299299

300-
// Validate tool exists in TOOL_REPOS (populated from external-tools.json).
300+
// Validate tool exists in TOOL_REPOS (populated from bundle-tools.json).
301301
if (!config) {
302302
throw new Error(
303303
`Tool "${toolName}" is defined in platform mappings but not found in TOOL_REPOS. ` +
304-
`Ensure "${toolName}" exists in external-tools.json with type "github-release".`,
304+
`Ensure "${toolName}" exists in bundle-tools.json with type "github-release".`,
305305
)
306306
}
307307

@@ -327,7 +327,7 @@ export async function downloadExternalTools(platform, arch, isMusl = false) {
327327
const tag = config.version
328328
const url = `https://github.com/${config.owner}/${config.repo}/releases/download/${tag}/${assetName}`
329329

330-
// Get SHA256 checksum from external-tools.json.
330+
// Get SHA256 checksum from bundle-tools.json.
331331
// SECURITY: Checksum verification is REQUIRED for all external tool downloads.
332332
// If checksum is missing, the build MUST fail.
333333
const toolConfig = externalTools[toolName]
@@ -336,7 +336,7 @@ export async function downloadExternalTools(platform, arch, isMusl = false) {
336336
if (!sha256) {
337337
throw new Error(
338338
`Missing SHA-256 checksum for ${toolName} asset: ${assetName}. ` +
339-
'This is a security requirement. Please update external-tools.json with the correct checksum.',
339+
'This is a security requirement. Please update bundle-tools.json with the correct checksum.',
340340
)
341341
}
342342

@@ -477,7 +477,7 @@ export async function downloadExternalTools(platform, arch, isMusl = false) {
477477
if (!wheelSha256) {
478478
throw new Error(
479479
`Missing SHA-256 checksum for socketsecurity wheel: ${wheelFilename}. ` +
480-
'Please update external-tools.json with the correct checksum.',
480+
'Please update bundle-tools.json with the correct checksum.',
481481
)
482482
}
483483

packages/cli/scripts/sea-build-utils/npm-packages.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import { getRootPath } from './downloads.mjs'
2020
const logger = getDefaultLogger()
2121

2222
/**
23-
* External tools configuration loaded from external-tools.json.
23+
* External tools configuration loaded from bundle-tools.json.
2424
*/
2525
const __dirname = path.dirname(fileURLToPath(import.meta.url))
26-
const externalToolsPath = path.join(__dirname, '../../external-tools.json')
26+
const externalToolsPath = path.join(__dirname, '../../bundle-tools.json')
2727
const externalTools = JSON.parse(readFileSync(externalToolsPath, 'utf8'))
2828

2929
/**
@@ -104,7 +104,7 @@ async function downloadNpmPackage(packageSpec, targetDir, expectedIntegrity) {
104104
/**
105105
* Download all npm packages with full dependency trees for VFS bundling.
106106
*
107-
* Downloads npm packages specified in external-tools.json that have type='npm',
107+
* Downloads npm packages specified in bundle-tools.json that have type='npm',
108108
* installs them with full production dependency trees using Arborist, and packages
109109
* them into a compressed tar.gz for VFS embedding.
110110
*
@@ -163,7 +163,7 @@ export async function downloadNpmPackages() {
163163
}
164164
}
165165

166-
// Collect npm packages from external-tools.json.
166+
// Collect npm packages from bundle-tools.json.
167167
const npmPackages = []
168168
for (const [toolName, toolConfig] of Object.entries(externalTools)) {
169169
if (toolConfig.type === 'npm') {
@@ -177,7 +177,7 @@ export async function downloadNpmPackages() {
177177
}
178178

179179
if (npmPackages.length === 0) {
180-
logger.warn('No npm packages defined in external-tools.json')
180+
logger.warn('No npm packages defined in bundle-tools.json')
181181
return null
182182
}
183183

packages/cli/scripts/sync-checksums.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env node
22
/**
3-
* Sync checksums from GitHub releases to external-tools.json.
3+
* Sync checksums from GitHub releases to bundle-tools.json.
44
*
55
* For each GitHub-released tool, this script:
66
* 1. Fetches checksums.txt from the release (if available)
77
* 2. Or downloads each asset and computes SHA-256 checksums
8-
* 3. Updates external-tools.json with the new checksums
8+
* 3. Updates bundle-tools.json with the new checksums
99
*
1010
* Usage:
1111
* node scripts/sync-checksums.mjs [--tool=<tool>] [--force] [--dry-run]
@@ -27,7 +27,7 @@ const __filename = fileURLToPath(import.meta.url)
2727
const __dirname = path.dirname(__filename)
2828
const packageRoot = path.join(__dirname, '..')
2929

30-
const EXTERNAL_TOOLS_FILE = path.join(packageRoot, 'external-tools.json')
30+
const EXTERNAL_TOOLS_FILE = path.join(packageRoot, 'bundle-tools.json')
3131

3232
/**
3333
* Compute SHA-256 hash of a file.
@@ -180,7 +180,7 @@ async function main() {
180180
const toolArg = args.find(arg => arg.startsWith('--tool='))
181181
const toolFilter = toolArg ? toolArg.split('=')[1] : undefined
182182

183-
// Load current external-tools.json.
183+
// Load current bundle-tools.json.
184184
if (!existsSync(EXTERNAL_TOOLS_FILE)) {
185185
console.error(`Error: ${EXTERNAL_TOOLS_FILE} not found`)
186186
process.exitCode = 1

packages/cli/scripts/test-wrapper.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* - Cross-platform compatibility (Windows/Unix)
77
* - Build validation before running tests
88
* - Environment variable loading from .env.test
9-
* - Inlined variable injection from external-tools.json
9+
* - Inlined variable injection from bundle-tools.json
1010
*/
1111

1212
import { existsSync } from 'node:fs'

packages/cli/src/env/checksum-utils.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function requireChecksum(
6363
if (!sha256) {
6464
throw new Error(
6565
`Missing SHA-256 checksum for ${toolName} asset: ${assetName}. ` +
66-
'This is a security requirement. Please update external-tools.json with the correct checksum.',
66+
'This is a security requirement. Please update bundle-tools.json with the correct checksum.',
6767
)
6868
}
6969
return sha256

packages/cli/src/env/coana-version.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function getCoanaVersion(): string {
1212
const version = process.env['INLINED_COANA_VERSION']
1313
if (!version) {
1414
throw new Error(
15-
'INLINED_COANA_VERSION not found. Please ensure @coana-tech/cli is properly configured in external-tools.json.',
15+
'INLINED_COANA_VERSION not found. Please ensure @coana-tech/cli is properly configured in bundle-tools.json.',
1616
)
1717
}
1818
return version

packages/cli/src/env/opengrep-version.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function getOpengrepVersion(): string {
1212
const version = process.env['INLINED_OPENGREP_VERSION']
1313
if (!version) {
1414
throw new Error(
15-
'INLINED_OPENGREP_VERSION not found. Please ensure opengrep is properly configured in external-tools.json.',
15+
'INLINED_OPENGREP_VERSION not found. Please ensure opengrep is properly configured in bundle-tools.json.',
1616
)
1717
}
1818
return version

packages/cli/src/env/pycli-version.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import process from 'node:process'
1010

1111
/**
1212
* Get the Socket Python CLI version (socketsecurity package) that should be installed.
13-
* This version is inlined at build time from external-tools.json.
13+
* This version is inlined at build time from bundle-tools.json.
1414
*
1515
* @returns Socket Python CLI version string (e.g., "0.8.0").
1616
* @throws Error if version is not inlined at build time.

0 commit comments

Comments
 (0)