feat: 完成 ApiState Temporal native 开发链

This commit is contained in:
root
2026-07-17 03:41:59 +02:00
parent d203b22183
commit 02b21ad891
17 changed files with 214 additions and 81 deletions
+2 -1
View File
@@ -19,7 +19,8 @@ function parseEnv(text: string): Map<string, string> {
export function readSecret(config: AppConfig, ref: SecretRef): string {
const path = config.runtime.secretSourcePaths[ref.sourceRef];
if (!path) throw new Error(`runtime.secretSourcePaths is missing sourceRef ${ref.sourceRef}`);
const value = parseEnv(readFileSync(path, "utf8")).get(ref.sourceKey);
const text = readFileSync(path, "utf8");
const value = ref.sourceKey === "contents" ? text.trim() : parseEnv(text).get(ref.sourceKey);
if (!value) throw new Error(`secret source ${ref.sourceRef} is missing key ${ref.sourceKey}`);
return value;
}