-
Notifications
You must be signed in to change notification settings - Fork 404
Retrieve binary secrets from AWS Secrets Manager #197
Conversation
@silasbw @Flydiverny Could you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. one small ask.
thanks for sending this in 🏅
@@ -39,6 +39,9 @@ class SecretsManagerBackend extends KVBackend { | |||
.getSecretValue({ SecretId: secretKey }) | |||
.promise() | |||
|
|||
if (data.SecretString === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you tweak this to explicitly check for the existence of the properties? I.e.,
if ('SecretBinary' in data) {
return data.SecretBinary
} else if ('SecretString' in data) {
return data.SecretString
}
this._logger('Unexpected data from Secrets Manager secret ${secretKey}')
return null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silasbw thank you for the comment, I fixed it.
return data.SecretString | ||
} | ||
|
||
this._logger(`Unexpected data from Secrets Manager secret ${secretKey}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._logger(`Unexpected data from Secrets Manager secret ${secretKey}`) | |
this._logger.error(`Unexpected data from Secrets Manager secret ${secretKey}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I changed logging level
Should fix #149 issue