Merged in feature/IO-2921-CARSTAR-Canada-Chatter-Integration (pull request #1881)

IO-2921 Adjustment to getting Secret
This commit is contained in:
Allan Carr
2024-11-02 00:54:56 +00:00

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;