mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 14:20:29 +00:00
refactor(security): unify command gating and blocked-key guards
This commit is contained in:
@@ -9,6 +9,7 @@ import { logVerbose } from "../../globals.js";
|
||||
import { clampInt } from "../../utils.js";
|
||||
import type { MsgContext } from "../templating.js";
|
||||
import type { ReplyPayload } from "../types.js";
|
||||
import { buildDisabledCommandReply } from "./command-gates.js";
|
||||
import { formatElevatedUnavailableMessage } from "./elevated-unavailable.js";
|
||||
import { stripMentions, stripStructuralPrefixes } from "./mentions.js";
|
||||
|
||||
@@ -188,9 +189,11 @@ export async function handleBashChatCommand(params: {
|
||||
};
|
||||
}): Promise<ReplyPayload> {
|
||||
if (!isCommandFlagEnabled(params.cfg, "bash")) {
|
||||
return {
|
||||
text: "⚠️ bash is disabled. Set commands.bash=true to enable. Docs: https://docs.openclaw.ai/tools/slash-commands#config",
|
||||
};
|
||||
return buildDisabledCommandReply({
|
||||
label: "bash",
|
||||
configKey: "bash",
|
||||
docsUrl: "https://docs.openclaw.ai/tools/slash-commands#config",
|
||||
});
|
||||
}
|
||||
|
||||
const agentId =
|
||||
|
||||
Reference in New Issue
Block a user