fix(cli): check movePath in apply_patch config guard

This commit is contained in:
Alex Alecu
2026-03-26 17:03:58 +02:00
parent 6105e356a9
commit a2151478ee
@@ -82,11 +82,14 @@ export namespace ConfigProtection {
}
}
// Check metadata.files[] (apply_patch file objects with absolute filePath)
// Check metadata.files[] (apply_patch file objects with absolute filePath/movePath)
const files = request.metadata?.files
if (Array.isArray(files)) {
for (const file of files) {
if (typeof file?.filePath === "string" && isAbsolute(file.filePath)) return true
for (const key of ["filePath", "movePath"] as const) {
const val = file?.[key]
if (typeof val === "string" && (path.isAbsolute(val) ? isAbsolute(val) : isRelative(val))) return true
}
}
}