mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 14:40:23 +00:00
feat(secrets): finalize external secrets runtime and migration hardening
This commit is contained in:
committed by
Peter Steinberger
parent
c5b89fbaea
commit
0e69660c41
@@ -77,6 +77,7 @@ describe("registerPreActionHooks", () => {
|
||||
program.command("status").action(async () => {});
|
||||
program.command("doctor").action(async () => {});
|
||||
program.command("completion").action(async () => {});
|
||||
program.command("secrets").action(async () => {});
|
||||
program.command("update").action(async () => {});
|
||||
program.command("channels").action(async () => {});
|
||||
program.command("directory").action(async () => {});
|
||||
@@ -155,7 +156,7 @@ describe("registerPreActionHooks", () => {
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("skips config guard for doctor and completion commands", async () => {
|
||||
it("skips config guard for doctor, completion, and secrets commands", async () => {
|
||||
await runCommand({
|
||||
parseArgv: ["doctor"],
|
||||
processArgv: ["node", "openclaw", "doctor"],
|
||||
@@ -164,6 +165,10 @@ describe("registerPreActionHooks", () => {
|
||||
parseArgv: ["completion"],
|
||||
processArgv: ["node", "openclaw", "completion"],
|
||||
});
|
||||
await runCommand({
|
||||
parseArgv: ["secrets"],
|
||||
processArgv: ["node", "openclaw", "secrets"],
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -29,6 +29,7 @@ const PLUGIN_REQUIRED_COMMANDS = new Set([
|
||||
"configure",
|
||||
"onboard",
|
||||
]);
|
||||
const CONFIG_GUARD_BYPASS_COMMANDS = new Set(["doctor", "completion", "secrets"]);
|
||||
|
||||
function getRootCommand(command: Command): Command {
|
||||
let current = command;
|
||||
@@ -75,7 +76,7 @@ export function registerPreActionHooks(program: Command, programVersion: string)
|
||||
if (!verbose) {
|
||||
process.env.NODE_NO_WARNINGS ??= "1";
|
||||
}
|
||||
if (commandPath[0] === "doctor" || commandPath[0] === "completion") {
|
||||
if (CONFIG_GUARD_BYPASS_COMMANDS.has(commandPath[0])) {
|
||||
return;
|
||||
}
|
||||
const { ensureConfigReady } = await import("./config-guard.js");
|
||||
|
||||
Reference in New Issue
Block a user