cf-envsync 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13110,7 +13110,15 @@ function decryptValue(token, password) {
|
|
|
13110
13110
|
function decryptEnvMap(envMap, password) {
|
|
13111
13111
|
const result = {};
|
|
13112
13112
|
for (const [key, value] of Object.entries(envMap)) {
|
|
13113
|
-
|
|
13113
|
+
if (isEnvsyncEncrypted(value)) {
|
|
13114
|
+
try {
|
|
13115
|
+
result[key] = decryptValue(value, password);
|
|
13116
|
+
} catch {
|
|
13117
|
+
throw new Error(`Failed to decrypt ${key}: wrong password or corrupted data. ` + `Check ENVSYNC_PASSWORD or .env.password`);
|
|
13118
|
+
}
|
|
13119
|
+
} else {
|
|
13120
|
+
result[key] = value;
|
|
13121
|
+
}
|
|
13114
13122
|
}
|
|
13115
13123
|
return result;
|
|
13116
13124
|
}
|