refactor(security): harden CommandAuthorized plumbing

This commit is contained in:
Peter Steinberger committed 2026-01-17 10:19:34 +00:00
1 parent 31e8ecca10
commit 69ba2765de
16 files changed
+92 -56

No files matched your search

+8
View File
@@ -58,3 +58,11 @@ export function hasInlineCommandTokens(text?: string): boolean {
if (!body.trim()) return false;
return /(?:^|\s)[/!][a-z]/i.test(body);
}
export function shouldComputeCommandAuthorized(
text?: string,
cfg?: ClawdbotConfig,
options?: CommandNormalizeOptions,
): boolean {
return isControlCommandMessage(text, cfg, options) || hasInlineCommandTokens(text);
}