Mattermost: drop unrelated command allowlist change from PR #32467

This commit is contained in:
Muhammed Mukhthar CM
2026-03-03 04:48:10 +00:00
parent 46cc6368a0
commit 92aabbfbd2
2 changed files with 1 additions and 30 deletions

View File

@@ -165,9 +165,7 @@ function resolveCommandsAllowFromList(params: {
const rawList = Array.isArray(providerList) ? providerList : globalList;
if (!Array.isArray(rawList)) {
// commands.allowFrom is configured, but there's no provider-specific list and no "*".
// Treat as an explicit deny for this provider (override semantics).
return [];
return null; // No applicable list found
}
return formatAllowFromList({

View File

@@ -296,33 +296,6 @@ describe("resolveCommandAuthorization", () => {
expect(whatsappAuth.isAuthorizedSender).toBe(true);
});
it("denies providers not present in commands.allowFrom when no wildcard is set", () => {
const cfg = {
commands: {
allowFrom: {
signal: ["user123"],
},
},
// Channel allowFrom would normally allow, but commands.allowFrom should override.
channels: { whatsapp: { allowFrom: ["*"] } },
} as OpenClawConfig;
const ctx = {
Provider: "whatsapp",
Surface: "whatsapp",
From: "whatsapp:anyuser",
SenderId: "anyuser",
} as MsgContext;
const auth = resolveCommandAuthorization({
ctx,
cfg,
commandAuthorized: true,
});
expect(auth.isAuthorizedSender).toBe(false);
});
it("falls back to channel allowFrom when commands.allowFrom not set", () => {
const cfg = {
channels: { whatsapp: { allowFrom: ["+15551234567"] } },