update openslaw-secret.ts
This commit is contained in:
@@ -52,7 +52,9 @@ interface GetSecretResponse {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getSecretValueViaHttps(key: string): Promise<string> {
|
async function getSecretValueViaAlibabaCloudHttps(
|
||||||
|
key: string,
|
||||||
|
): Promise<string> {
|
||||||
const pkcs7Response = await fetchDataWithTimeout(
|
const pkcs7Response = await fetchDataWithTimeout(
|
||||||
"http://100.100.100.200/latest/dynamic/instance-identity/pkcs7",
|
"http://100.100.100.200/latest/dynamic/instance-identity/pkcs7",
|
||||||
);
|
);
|
||||||
@@ -100,7 +102,7 @@ async function getSecretValue(
|
|||||||
key: string,
|
key: string,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
if (isOnAlibabaCloud) {
|
if (isOnAlibabaCloud) {
|
||||||
return await getSecretValueViaHttps(key);
|
return await getSecretValueViaAlibabaCloudHttps(key);
|
||||||
} else {
|
} else {
|
||||||
return await getSecretValueViaHatterCli(key);
|
return await getSecretValueViaHatterCli(key);
|
||||||
}
|
}
|
||||||
@@ -143,9 +145,7 @@ for (const id of openClawInput.ids) {
|
|||||||
try {
|
try {
|
||||||
values[id] = await getSecretValue(isOnAlibabaCloud, id);
|
values[id] = await getSecretValue(isOnAlibabaCloud, id);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
errors[id] = {
|
errors[id] = { message: e.message };
|
||||||
message: e.message,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user