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

推荐订阅源

Google DeepMind News
Google DeepMind News
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
A
About on SuperTechFans
WordPress大学
WordPress大学
B
Blog
Martin Fowler
Martin Fowler
Jina AI
Jina AI
I
InfoQ
P
Proofpoint News Feed
小众软件
小众软件
S
SegmentFault 最新的问题
V
V2EX
B
Blog RSS Feed
量子位
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
美团技术团队

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
fix: keep Discord DM wildcard out of owner checks · openc...
steipete · 2026-04-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -10,6 +10,7 @@ import {

1010

resolveDiscordChannelConfig,

1111

resolveDiscordChannelConfigWithFallback,

1212

resolveDiscordGuildEntry,

13+

resolveDiscordOwnerAccess,

1314

resolveDiscordShouldRequireMention,

1415

resolveGroupDmAllow,

1516

shouldEmitDiscordReactionNotification,

@@ -252,6 +253,22 @@ describe("discord allowlist helpers", () => {

252253

expect(allowListMatches(allow, { id: "member-123" })).toBe(true);

253254

expect(allowListMatches(allow, { id: "member-999" })).toBe(false);

254255

});

256+
257+

it("does not treat DM wildcard access as owner access", () => {

258+

const wildcardOnly = resolveDiscordOwnerAccess({

259+

allowFrom: ["*"],

260+

sender: { id: "123" },

261+

});

262+

expect(wildcardOnly.ownerAllowList).toBeNull();

263+

expect(wildcardOnly.ownerAllowed).toBe(false);

264+
265+

const explicitOwner = resolveDiscordOwnerAccess({

266+

allowFrom: ["*", "user:123"],

267+

sender: { id: "123" },

268+

});

269+

expect(explicitOwner.ownerAllowList).not.toBeNull();

270+

expect(explicitOwner.ownerAllowed).toBe(true);

271+

});

255272

});

256273
257274

describe("discord guild/channel resolution", () => {

Original file line numberDiff line numberDiff line change

@@ -279,8 +279,11 @@ export function resolveDiscordOwnerAccess(params: {

279279

ownerAllowList: DiscordAllowList | null;

280280

ownerAllowed: boolean;

281281

} {

282+

const ownerAllowFrom = params.allowFrom?.filter(

283+

(entry) => (normalizeOptionalString(entry) ?? "") !== "*",

284+

);

282285

const ownerAllowList = normalizeDiscordAllowList(

283-

params.allowFrom,

286+

ownerAllowFrom && ownerAllowFrom.length > 0 ? ownerAllowFrom : undefined,

284287

DISCORD_OWNER_ALLOWLIST_PREFIXES,

285288

);

286289

const ownerAllowed = ownerAllowList

Original file line numberDiff line numberDiff line change

@@ -342,6 +342,39 @@ describe("Discord native slash commands with commands.allowFrom", () => {

342342

expectUnauthorizedReply(interaction);

343343

});

344344
345+

it("does not treat open-DM wildcard access as guild command owner authorization", async () => {

346+

const { dispatchSpy, interaction } = await runGuildSlashCommand({

347+

userId: "999999999999999999",

348+

mutateConfig: (cfg) => {

349+

cfg.commands = {

350+

...cfg.commands,

351+

useAccessGroups: false,

352+

allowFrom: undefined,

353+

};

354+

cfg.channels = {

355+

...cfg.channels,

356+

discord: {

357+

...cfg.channels?.discord,

358+

dmPolicy: "open",

359+

allowFrom: ["*"],

360+

guilds: {

361+

"000000000000000000": {

362+

channels: {

363+

"111111111111111111": {

364+

enabled: true,

365+

requireMention: false,

366+

},

367+

},

368+

},

369+

},

370+

},

371+

};

372+

},

373+

});

374+

expect(dispatchSpy).not.toHaveBeenCalled();

375+

expectUnauthorizedReply(interaction);

376+

});

377+
345378

it("rejects guild slash commands when commands.allowFrom.discord does not match the sender", async () => {

346379

const { dispatchSpy, interaction } = await runGuildSlashCommand({

347380

userId: "999999999999999999",

Original file line numberDiff line numberDiff line change

@@ -174,6 +174,8 @@ describe("monitorDiscordProvider", () => {

174174

vi.doMock("../accounts.js", () => ({

175175

resolveDiscordAccount: (...args: Parameters<typeof resolveDiscordAccountMock>) =>

176176

resolveDiscordAccountMock(...args),

177+

resolveDiscordAccountAllowFrom: () => undefined,

178+

resolveDiscordAccountDmPolicy: () => undefined,

177179

}));

178180

vi.doMock("../probe.js", () => ({

179181

fetchDiscordApplicationId: async () => "app-1",