refactor(security): unify exec approval request matching

This commit is contained in:
Peter Steinberger
2026-02-26 03:54:27 +01:00
parent 75dfb71e4e
commit 92eb3dfc9d
8 changed files with 182 additions and 78 deletions

View File

@@ -43,7 +43,7 @@ export function createExecApprovalHandlers(
const p = params as {
id?: string;
command: string;
commandArgv?: string[] | null;
commandArgv?: string[];
cwd?: string;
nodeId?: string;
host?: string;
@@ -63,7 +63,7 @@ export function createExecApprovalHandlers(
const nodeId = typeof p.nodeId === "string" ? p.nodeId.trim() : "";
const commandArgv = Array.isArray(p.commandArgv)
? p.commandArgv.map((entry) => String(entry))
: null;
: undefined;
if (host === "node" && !nodeId) {
respond(
false,