mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 02:00:21 +00:00
plugins: suppress provenance warning for allowlisted local plugins (#58604)
Co-authored-by: me <shlomo@vmi1916417.contaboserver.net>
This commit is contained in:
@@ -3633,7 +3633,7 @@ module.exports = {
|
||||
useNoBundledPlugins();
|
||||
const scenarios = [
|
||||
{
|
||||
label: "warns when loaded non-bundled plugin has no install/load-path provenance",
|
||||
label: "does not warn when loaded non-bundled plugin is in plugins.allow",
|
||||
loadRegistry: () => {
|
||||
return withStateDir((stateDir) => {
|
||||
const globalDir = path.join(stateDir, "extensions", "rogue");
|
||||
@@ -3656,6 +3656,35 @@ module.exports = {
|
||||
},
|
||||
});
|
||||
|
||||
return { registry, warnings, pluginId: "rogue", expectWarning: false };
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "warns when loaded non-bundled plugin has no provenance and no allowlist is set",
|
||||
loadRegistry: () => {
|
||||
const stateDir = makeTempDir();
|
||||
return withEnv({ OPENCLAW_STATE_DIR: stateDir }, () => {
|
||||
const globalDir = path.join(stateDir, "extensions", "rogue");
|
||||
mkdirSafe(globalDir);
|
||||
writePlugin({
|
||||
id: "rogue",
|
||||
body: `module.exports = { id: "rogue", register() {} };`,
|
||||
dir: globalDir,
|
||||
filename: "index.cjs",
|
||||
});
|
||||
|
||||
const warnings: string[] = [];
|
||||
const registry = loadOpenClawPlugins({
|
||||
cache: false,
|
||||
logger: createWarningLogger(warnings),
|
||||
config: {
|
||||
plugins: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return { registry, warnings, pluginId: "rogue", expectWarning: true };
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user