


























@@ -200,6 +200,27 @@ describe("installPluginFromGitSpec", () => {
200200}
201201});
202202203+it("redacts authenticated git URLs from command failure details", async () => {
204+runCommandWithTimeoutMock.mockResolvedValueOnce({
205+code: 1,
206+stdout: "",
207+stderr: "fatal: could not read Username for 'https://token:secret@github.com/acme/demo.git'",
208+});
209+210+const result = await installPluginFromGitSpec({
211+spec: "git:https://token:secret@github.com/acme/demo.git",
212+});
213+214+expect(result.ok).toBe(false);
215+if (!result.ok) {
216+expect(result.error).toContain("failed to clone github.com/acme/demo");
217+expect(result.error).toContain("https://***:***@github.com/acme/demo.git");
218+expect(result.error).not.toContain("token");
219+expect(result.error).not.toContain("secret");
220+}
221+expect(installPluginFromInstalledPackageDirMock).not.toHaveBeenCalled();
222+});
223+203224it("keeps the existing managed repo when replacement install fails", async () => {
204225const gitDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-git-install-preserve-"));
205226const normalizedSpec = "git:https://github.com/acme/demo.git";
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。