惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
V
V2EX
量子位
Last Week in AI
Last Week in AI
Jina AI
Jina AI
博客园 - 【当耐特】
爱范儿
爱范儿
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
小众软件
小众软件
IT之家
IT之家
博客园_首页
博客园 - 聂微东
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tighten discord dm auth assertions · openclaw/openc...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -27,76 +27,64 @@ describe("resolveDiscordTextCommandAccess", () => {

2727

};

28282929

it("authorizes guild text commands from owner allowlists", async () => {

30-

await expect(

31-

resolveDiscordTextCommandAccess({

32-

accountId: "default",

33-

sender,

34-

ownerAllowFrom: ["discord:123"],

35-

memberAccessConfigured: false,

36-

memberAllowed: false,

37-

allowNameMatching: false,

38-

allowTextCommands: true,

39-

hasControlCommand: true,

40-

}),

41-

).resolves.toMatchObject({

42-

authorized: true,

43-

shouldBlockControlCommand: false,

30+

const result = await resolveDiscordTextCommandAccess({

31+

accountId: "default",

32+

sender,

33+

ownerAllowFrom: ["discord:123"],

34+

memberAccessConfigured: false,

35+

memberAllowed: false,

36+

allowNameMatching: false,

37+

allowTextCommands: true,

38+

hasControlCommand: true,

4439

});

40+

expect(result.authorized).toBe(true);

41+

expect(result.shouldBlockControlCommand).toBe(false);

4542

});

46434744

it("authorizes guild text commands from member access facts", async () => {

48-

await expect(

49-

resolveDiscordTextCommandAccess({

50-

accountId: "default",

51-

sender,

52-

ownerAllowFrom: [],

53-

memberAccessConfigured: true,

54-

memberAllowed: true,

55-

allowNameMatching: false,

56-

allowTextCommands: true,

57-

hasControlCommand: true,

58-

}),

59-

).resolves.toMatchObject({

60-

authorized: true,

61-

shouldBlockControlCommand: false,

45+

const result = await resolveDiscordTextCommandAccess({

46+

accountId: "default",

47+

sender,

48+

ownerAllowFrom: [],

49+

memberAccessConfigured: true,

50+

memberAllowed: true,

51+

allowNameMatching: false,

52+

allowTextCommands: true,

53+

hasControlCommand: true,

6254

});

55+

expect(result.authorized).toBe(true);

56+

expect(result.shouldBlockControlCommand).toBe(false);

6357

});

64586559

it("blocks unauthorized guild text control commands", async () => {

66-

await expect(

67-

resolveDiscordTextCommandAccess({

68-

accountId: "default",

69-

sender,

70-

ownerAllowFrom: ["discord:999"],

71-

memberAccessConfigured: true,

72-

memberAllowed: false,

73-

allowNameMatching: false,

74-

allowTextCommands: true,

75-

hasControlCommand: true,

76-

}),

77-

).resolves.toMatchObject({

78-

authorized: false,

79-

shouldBlockControlCommand: true,

60+

const result = await resolveDiscordTextCommandAccess({

61+

accountId: "default",

62+

sender,

63+

ownerAllowFrom: ["discord:999"],

64+

memberAccessConfigured: true,

65+

memberAllowed: false,

66+

allowNameMatching: false,

67+

allowTextCommands: true,

68+

hasControlCommand: true,

8069

});

70+

expect(result.authorized).toBe(false);

71+

expect(result.shouldBlockControlCommand).toBe(true);

8172

});

82738374

it("preserves configured mode when access groups are disabled", async () => {

84-

await expect(

85-

resolveDiscordTextCommandAccess({

86-

accountId: "default",

87-

sender,

88-

ownerAllowFrom: [],

89-

memberAccessConfigured: false,

90-

memberAllowed: false,

91-

allowNameMatching: false,

92-

cfg: { commands: { useAccessGroups: false } },

93-

allowTextCommands: true,

94-

hasControlCommand: true,

95-

}),

96-

).resolves.toMatchObject({

97-

authorized: true,

98-

shouldBlockControlCommand: false,

75+

const result = await resolveDiscordTextCommandAccess({

76+

accountId: "default",

77+

sender,

78+

ownerAllowFrom: [],

79+

memberAccessConfigured: false,

80+

memberAllowed: false,

81+

allowNameMatching: false,

82+

cfg: { commands: { useAccessGroups: false } },

83+

allowTextCommands: true,

84+

hasControlCommand: true,

9985

});

86+

expect(result.authorized).toBe(true);

87+

expect(result.shouldBlockControlCommand).toBe(false);

10088

});

10189

});

10290