Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Retrieve binary secrets from AWS Secrets Manager #197

Merged
merged 3 commits into from
Nov 7, 2019

Conversation

arruzk
Copy link
Contributor

@arruzk arruzk commented Nov 5, 2019

Should fix #149 issue

@arruzk
Copy link
Contributor Author

arruzk commented Nov 6, 2019

@silasbw @Flydiverny Could you please take a look?

@Flydiverny Flydiverny self-requested a review November 6, 2019 11:43
Copy link
Contributor

@silasbw silasbw left a 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) {
Copy link
Contributor

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

Copy link
Contributor Author

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}`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this._logger(`Unexpected data from Secrets Manager secret ${secretKey}`)
this._logger.error(`Unexpected data from Secrets Manager secret ${secretKey}`)

Copy link
Contributor Author

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

@Flydiverny Flydiverny merged commit 731edb1 into external-secrets:master Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: support SecretBinary
3 participants