From b6abc665a5d65a1dfd9c2c19f51c10bbc26a150c Mon Sep 17 00:00:00 2001 From: Martin Meciar Date: Thu, 15 Feb 2024 19:01:07 +0100 Subject: [PATCH] fix(#1545): empty strings encryption enable empty strings to be encrypted --- packages/bruno-electron/src/store/env-secrets.js | 2 +- packages/bruno-electron/src/utils/encryption.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bruno-electron/src/store/env-secrets.js b/packages/bruno-electron/src/store/env-secrets.js index b3d26c7230..8ded05ae9c 100644 --- a/packages/bruno-electron/src/store/env-secrets.js +++ b/packages/bruno-electron/src/store/env-secrets.js @@ -28,7 +28,7 @@ class EnvironmentSecretsStore { } isValidValue(val) { - return val && typeof val === 'string' && val.length > 0; + return typeof val === 'string' && val.length >= 0; } storeEnvSecrets(collectionPathname, environment) { diff --git a/packages/bruno-electron/src/utils/encryption.js b/packages/bruno-electron/src/utils/encryption.js index 980311ff9b..b73e437e66 100644 --- a/packages/bruno-electron/src/utils/encryption.js +++ b/packages/bruno-electron/src/utils/encryption.js @@ -48,7 +48,7 @@ function safeStorageDecrypt(str) { } function encryptString(str) { - if (!str || typeof str !== 'string' || str.length === 0) { + if (typeof str !== 'string') { throw new Error('Encrypt failed: invalid string'); }