refactor(security): reuse shared allowlist normalization

This commit is contained in:
Peter Steinberger
2026-02-18 23:48:23 +00:00
parent 54e9924fc3
commit 89a0b95af4
2 changed files with 6 additions and 5 deletions

View File

@@ -9,13 +9,11 @@ import { formatCliCommand } from "../cli/command-format.js";
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "../config/commands.js";
import type { OpenClawConfig } from "../config/config.js";
import { readChannelAllowFromStore } from "../pairing/pairing-store.js";
import { normalizeStringEntries } from "../shared/string-normalization.js";
import type { SecurityAuditFinding, SecurityAuditSeverity } from "./audit.js";
function normalizeAllowFromList(list: Array<string | number> | undefined | null): string[] {
if (!Array.isArray(list)) {
return [];
}
return list.map((v) => String(v).trim()).filter(Boolean);
return normalizeStringEntries(Array.isArray(list) ? list : undefined);
}
function classifyChannelWarningSeverity(message: string): SecurityAuditSeverity {