mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-07 23:31:07 +00:00
fix(plugins): keep auto-enabled channels behind allowlists
This commit is contained in:
committed by
Peter Steinberger
parent
f7d24c1ed5
commit
cd08facd7a
@@ -1098,6 +1098,36 @@ describe("loadOpenClawPlugins", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps auto-enabled bundled channels behind restrictive allowlists", () => {
|
||||
setupBundledTelegramPlugin();
|
||||
const rawConfig = {
|
||||
channels: {
|
||||
telegram: {
|
||||
botToken: "x",
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
allow: ["browser"],
|
||||
},
|
||||
} satisfies PluginLoadConfig;
|
||||
const autoEnabled = applyPluginAutoEnable({
|
||||
config: rawConfig,
|
||||
env: {},
|
||||
});
|
||||
|
||||
const registry = loadOpenClawPlugins({
|
||||
cache: false,
|
||||
workspaceDir: cachedBundledTelegramDir,
|
||||
config: autoEnabled.config,
|
||||
activationSourceConfig: rawConfig,
|
||||
autoEnabledReasons: autoEnabled.autoEnabledReasons,
|
||||
});
|
||||
|
||||
const telegram = registry.plugins.find((entry) => entry.id === "telegram");
|
||||
expect(telegram?.status).toBe("disabled");
|
||||
expect(telegram?.error).toBe("not in allowlist");
|
||||
});
|
||||
|
||||
it("preserves all auto-enable reasons in activation metadata", () => {
|
||||
setupBundledTelegramPlugin();
|
||||
const rawConfig = {
|
||||
|
||||
Reference in New Issue
Block a user