mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 03:50:20 +00:00
feat(secrets): finalize mode rename and validated exec docs
This commit is contained in:
committed by
Peter Steinberger
parent
ba2eb583c0
commit
06290b49b2
@@ -232,7 +232,7 @@ describe("ensureApiKeyFromEnvOrPrompt", () => {
|
||||
filemain: {
|
||||
source: "file",
|
||||
path: "/tmp/does-not-exist-secrets.json",
|
||||
mode: "jsonPointer",
|
||||
mode: "json",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -176,11 +176,11 @@ async function resolveApiKeyRefForOnboarding(params: {
|
||||
}
|
||||
const idPrompt =
|
||||
providerEntry.source === "file"
|
||||
? "Secret id (JSON pointer for jsonPointer mode, or 'value' for raw mode)"
|
||||
? "Secret id (JSON pointer for json mode, or 'value' for singleValue mode)"
|
||||
: "Secret id for the exec provider";
|
||||
const idDefault =
|
||||
providerEntry.source === "file"
|
||||
? providerEntry.mode === "raw"
|
||||
? providerEntry.mode === "singleValue"
|
||||
? "value"
|
||||
: defaultFilePointer
|
||||
: `${params.provider}/apiKey`;
|
||||
@@ -195,17 +195,17 @@ async function resolveApiKeyRefForOnboarding(params: {
|
||||
}
|
||||
if (
|
||||
providerEntry.source === "file" &&
|
||||
providerEntry.mode !== "raw" &&
|
||||
providerEntry.mode !== "singleValue" &&
|
||||
!isValidFileSecretRefId(candidate)
|
||||
) {
|
||||
return 'Use an absolute JSON pointer like "/providers/openai/apiKey".';
|
||||
}
|
||||
if (
|
||||
providerEntry.source === "file" &&
|
||||
providerEntry.mode === "raw" &&
|
||||
providerEntry.mode === "singleValue" &&
|
||||
candidate !== "value"
|
||||
) {
|
||||
return 'Raw file mode expects id "value".';
|
||||
return 'singleValue mode expects id "value".';
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
@@ -775,7 +775,7 @@ describe("applyAuthChoice", () => {
|
||||
filemain: {
|
||||
source: "file",
|
||||
path: "/tmp/openclaw-missing-secrets.json",
|
||||
mode: "jsonPointer",
|
||||
mode: "json",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -268,7 +268,7 @@ describe("promptCustomApiConfig", () => {
|
||||
filemain: {
|
||||
source: "file",
|
||||
path: "/tmp/openclaw-missing-provider.json",
|
||||
mode: "jsonPointer",
|
||||
mode: "json",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user