fix: handle empty string to allow clearing secret on update

This commit is contained in:
Scott Wilson
2024-11-19 08:16:30 -08:00
parent 61d516ef35
commit b6d8be2105
@@ -414,7 +414,8 @@ export const secretV2BridgeServiceFactory = ({
type: KmsDataKey.SecretManager, type: KmsDataKey.SecretManager,
projectId projectId
}); });
const encryptedValue = secretValue const encryptedValue =
typeof secretValue === "string"
? { ? {
encryptedValue: secretManagerEncryptor({ plainText: Buffer.from(secretValue) }).cipherTextBlob, encryptedValue: secretManagerEncryptor({ plainText: Buffer.from(secretValue) }).cipherTextBlob,
references: getAllSecretReferences(secretValue).nestedReferences references: getAllSecretReferences(secretValue).nestedReferences