You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The salt value can now either be included in the loaded configuration file, or passed in as an argument into the loadConfig function. The config file option has priority.
return{success: false,error: `No salt configuration provided: either specify salt in config file, or pass in path on config load.`,isSaltFileError: true,config: configData};
120
+
}
120
121
121
-
// if the salt file load failed, we have failed
122
-
if(!saltData){
123
-
log('[SALT] Error while loading the salt file!');
124
-
return{
125
-
success: false,
126
-
isSaltFileError: true,
127
-
error: `Invalid salt file: '${saltFilePath}'`,
128
-
// send the existing config alongside so if this config is the backup one, error messages
Copy file name to clipboardExpand all lines: src/config/utils.ts
-9Lines changed: 0 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,6 @@
15
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
17
17
importfsfrom'node:fs';
18
-
importosfrom'node:os';
19
-
importpathfrom'node:path';
20
18
importtomlfrom'toml';
21
19
import{createHash}from'node:crypto';
22
20
importstableStringifyfrom'safe-stable-stringify';
@@ -92,13 +90,6 @@ export function generateConfigHash<T extends Config.CoreConfiguration>(config: T
92
90
deleteconfigCopy.messages;
93
91
}
94
92
95
-
// remove the "algorithm.salt" part as it may have injected keys
96
-
// TODO: this enables messing with the salt file path pre-injection without signature validations, but is required for compatibility w/ the injection workflow
97
-
deleteconfigCopy.algorithm!.salt!.value;
98
-
// mock the salt source as STRING to ensure that both imported and saved
99
-
// (with pre-injected salt) config files work
100
-
configCopy.algorithm!.salt!.source='STRING';
101
-
102
93
// generate a stable JSON representation
103
94
conststableJson=stableStringify(configCopy);
104
95
if(typeofstableJson!=='string')thrownewError(`Unable to serialise config object to JSON.`);
0 commit comments