IO-2921 Adjustment to getting Secret

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
Allan Carr
2024-11-01 17:55:33 -07:00
parent c9e28b1ed2
commit 73ab02225e

View File

@@ -160,7 +160,8 @@ async function getPrivateKey() {
try {
const { SecretString, SecretBinary } = await client.send(command);
if (SecretString || SecretBinary) logger.log("chatter-retrieved-private-key", "DEBUG", "api", null, null);
return SecretString || Buffer.from(SecretBinary, "base64").toString("ascii");
const chatterPrivateKey = SecretString ? JSON.parse(SecretString) : JSON.parse(Buffer.from(SecretBinary, "base64").toString("ascii"));
return chatterPrivateKey.private_key;
} catch (error) {
logger.log("chatter-get-private-key", "ERROR", "api", null, error);
throw err;