mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 15:50:25 +00:00
fix(heartbeat): block owner-only auth inheritance for exec events (#57652)
This commit is contained in:
@@ -194,6 +194,27 @@ describe("resolveCommandAuthorization", () => {
|
||||
expect(auth.ownerList).toEqual(["123"]);
|
||||
});
|
||||
|
||||
it("suppresses inherited owner status when the context forbids it", () => {
|
||||
const cfg = {
|
||||
channels: { telegram: { allowFrom: ["owner-123"] } },
|
||||
} as OpenClawConfig;
|
||||
|
||||
const auth = resolveCommandAuthorization({
|
||||
ctx: {
|
||||
Provider: "exec-event",
|
||||
Surface: "telegram",
|
||||
OriginatingChannel: "telegram",
|
||||
From: "owner-123",
|
||||
To: "owner-123",
|
||||
ForceSenderIsOwnerFalse: true,
|
||||
} as MsgContext,
|
||||
cfg,
|
||||
commandAuthorized: true,
|
||||
});
|
||||
|
||||
expect(auth.senderIsOwner).toBe(false);
|
||||
});
|
||||
|
||||
it("does not infer a provider from channel allowlists for webchat command contexts", () => {
|
||||
const cfg = {
|
||||
channels: { whatsapp: { allowFrom: ["+15551234567"] } },
|
||||
|
||||
Reference in New Issue
Block a user