feat(javascript): record Electron integrity mismatches
This commit is contained in:
@@ -16,6 +16,7 @@ import type { CliInstance } from "./types.js";
|
||||
import { runCliJavaScriptApplicationAnalysis } from "./javascriptApplicationAnalysis.js";
|
||||
import { withCommandCancellation } from "./commandCancellation.js";
|
||||
import type { CliResultOutput } from "./streamedJsonOutput.js";
|
||||
import { javascriptApplicationOptions } from "../cliObservationOptions.js";
|
||||
|
||||
/** Register provider-neutral binary overview and procedure CLI commands. */
|
||||
export const registerCoreBinaryCommands = (
|
||||
@@ -53,7 +54,10 @@ const registerOverviewCommands = (
|
||||
args: z.object({
|
||||
path: z.string().describe("App, program, or analysis database path"),
|
||||
}),
|
||||
options: overviewOptions,
|
||||
options: overviewOptions.extend({
|
||||
integrityPolicy: javascriptApplicationOptions.shape.integrityPolicy,
|
||||
}),
|
||||
alias: { integrityPolicy: "integrity-policy" },
|
||||
run: async ({ args, options, format }) => {
|
||||
const output =
|
||||
resultOutput === undefined
|
||||
@@ -66,7 +70,10 @@ const registerOverviewCommands = (
|
||||
return withCommandCancellation((signal) =>
|
||||
logCliCommand(logger, "analyze", () =>
|
||||
runCliJavaScriptApplicationAnalysis(
|
||||
{ input_path: resolve(args.path) },
|
||||
{
|
||||
input_path: resolve(args.path),
|
||||
integrity_policy: options.integrityPolicy,
|
||||
},
|
||||
output,
|
||||
signal,
|
||||
),
|
||||
|
||||
@@ -193,11 +193,16 @@ const registerJavaScriptApplicationCommand = (
|
||||
path: z.string().describe("ASAR or extracted application path"),
|
||||
}),
|
||||
options: javascriptApplicationOptions,
|
||||
alias: { integrityPolicy: "integrity-policy" },
|
||||
run: ({ args, options, format }) =>
|
||||
withCommandCancellation((signal) =>
|
||||
logCliCommand(logger, CLI_COMMANDS.analyzeJavaScriptApplication, () =>
|
||||
runCliJavaScriptApplicationAnalysis(
|
||||
{ input_path: args.path, format: options.artifactFormat },
|
||||
{
|
||||
input_path: args.path,
|
||||
format: options.artifactFormat,
|
||||
integrity_policy: options.integrityPolicy,
|
||||
},
|
||||
resultOutput === undefined
|
||||
? undefined
|
||||
: {
|
||||
|
||||
Reference in New Issue
Block a user