Merged in feature/IO-2921-CARSTAR-Canada-Chatter-Integration (pull request #1881)
IO-2921 Adjustment to getting Secret
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user