mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 02:54:46 +00:00
Check ClawHub trust before plugin installs (#81307)
Merged via squash.
Prepared head SHA: 273fd7c20e
Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com>
Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com>
Reviewed-by: @jesse-merhi
This commit is contained in:
@@ -620,6 +620,33 @@ describe("plugins cli install", () => {
|
||||
expect(installPluginFromNpmSpec).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("passes ClawHub risk acknowledgement to explicit ClawHub installs", async () => {
|
||||
loadConfig.mockReturnValue(createEmptyPluginConfig());
|
||||
parseClawHubPluginSpec.mockReturnValue({ name: "demo" });
|
||||
installPluginFromClawHub.mockResolvedValue(
|
||||
createClawHubInstallResult({
|
||||
pluginId: "demo",
|
||||
packageName: "demo",
|
||||
version: "1.2.3",
|
||||
channel: "official",
|
||||
}),
|
||||
);
|
||||
enablePluginInConfig.mockReturnValue({ config: createEnabledPluginConfig("demo") });
|
||||
applyExclusiveSlotSelection.mockReturnValue({
|
||||
config: createEnabledPluginConfig("demo"),
|
||||
warnings: [],
|
||||
});
|
||||
|
||||
await runPluginsCommand(["plugins", "install", "clawhub:demo", "--acknowledge-clawhub-risk"]);
|
||||
|
||||
expect(installPluginFromClawHub).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
spec: "clawhub:demo",
|
||||
acknowledgeClawHubRisk: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("passes the active profile extensions dir to ClawHub installs", async () => {
|
||||
const extensionsDir = useProfileExtensionsDir();
|
||||
const cfg = createEmptyPluginConfig();
|
||||
|
||||
Reference in New Issue
Block a user