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

推荐订阅源

The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
WordPress大学
WordPress大学
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
P
Proofpoint News Feed
D
DataBreaches.Net

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(plugins): require owner for plugin writes (#93353) · ...
eleqtrizit · 2026-06-16 · via Recent Commits to openclaw:main

@@ -60,12 +60,31 @@ vi.mock("../../cli/plugins-install-persist.js", async (importOriginal) => ({

60606161

const workspaceHarness = createCommandWorkspaceHarness("openclaw-command-plugins-install-");

626263-

function buildPluginsParams(commandBodyNormalized: string, workspaceDir: string) {

64-

return buildPluginsCommandParams({

63+

function buildPluginsParams(

64+

commandBodyNormalized: string,

65+

workspaceDir: string,

66+

options: {

67+

gatewayClientScopes?: string[];

68+

omitGatewayClientScopes?: boolean;

69+

senderIsOwner?: boolean;

70+

} = {},

71+

) {

72+

const params = buildPluginsCommandParams({

6573

commandBodyNormalized,

6674

workspaceDir,

67-

gatewayClientScopes: ["operator.admin", "operator.write", "operator.pairing"],

75+

gatewayClientScopes: options.gatewayClientScopes ?? [

76+

"operator.admin",

77+

"operator.write",

78+

"operator.pairing",

79+

],

6880

});

81+

if (options.senderIsOwner !== undefined) {

82+

params.command.senderIsOwner = options.senderIsOwner;

83+

}

84+

if (options.omitGatewayClientScopes) {

85+

delete params.ctx.GatewayClientScopes;

86+

}

87+

return params;

6988

}

70897190

function expectPersistedInstall(pluginId: string, expectedInstall: Record<string, unknown>): void {

@@ -125,6 +144,66 @@ describe("handleCommands /plugins install", () => {

125144

});

126145

});

127146147+

it("blocks channel-authorized non-owner plugin installs before installer side effects", async () => {

148+

await withTempHome("openclaw-command-plugins-home-", async () => {

149+

const workspaceDir = await workspaceHarness.createWorkspace();

150+

const pluginDir = path.join(workspaceDir, "fixtures", "channel-installed-plugin");

151+

await fs.mkdir(pluginDir, { recursive: true });

152+153+

const params = buildPluginsParams(`/plugins install ${pluginDir}`, workspaceDir, {

154+

omitGatewayClientScopes: true,

155+

senderIsOwner: false,

156+

});

157+

params.command.channel = "telegram";

158+

params.command.channelId = "telegram";

159+

params.command.surface = "telegram";

160+

params.command.senderId = "telegram-user-3";

161+

params.command.isAuthorizedSender = true;

162+

params.ctx.Provider = "telegram";

163+

params.ctx.Surface = "telegram";

164+165+

const result = await handlePluginsCommand(params, true);

166+167+

expect(result?.shouldContinue).toBe(false);

168+

expect(installPluginFromPathMock).not.toHaveBeenCalled();

169+

expect(persistPluginInstallMock).not.toHaveBeenCalled();

170+

});

171+

});

172+173+

it("allows gateway clients with operator.admin to install plugins", async () => {

174+

installPluginFromPathMock.mockResolvedValue({

175+

ok: true,

176+

pluginId: "gateway-admin-plugin",

177+

targetDir: "/tmp/gateway-admin-plugin",

178+

version: "0.0.1",

179+

extensions: ["index.js"],

180+

});

181+

persistPluginInstallMock.mockResolvedValue({});

182+183+

await withTempHome("openclaw-command-plugins-home-", async () => {

184+

const workspaceDir = await workspaceHarness.createWorkspace();

185+

const pluginDir = path.join(workspaceDir, "fixtures", "gateway-admin-plugin");

186+

await fs.mkdir(pluginDir, { recursive: true });

187+188+

const params = buildPluginsParams(`/plugins install ${pluginDir}`, workspaceDir, {

189+

gatewayClientScopes: ["operator.admin", "operator.write"],

190+

senderIsOwner: false,

191+

});

192+193+

const result = await handlePluginsCommand(params, true);

194+195+

expect(result?.shouldContinue).toBe(false);

196+

expect(result?.reply?.text).toContain('Installed plugin "gateway-admin-plugin"');

197+

expect(mockFirstObjectArg(installPluginFromPathMock).path).toBe(pluginDir);

198+

expectPersistedInstall("gateway-admin-plugin", {

199+

source: "path",

200+

sourcePath: pluginDir,

201+

installPath: "/tmp/gateway-admin-plugin",

202+

version: "0.0.1",

203+

});

204+

});

205+

});

206+128207

it("installs from an explicit clawhub: spec", async () => {

129208

installPluginFromClawHubMock.mockResolvedValue({

130209

ok: true,