@@ -20,7 +20,7 @@ import { validateConfigFile } from './validateConfig';
2020import { loadSaltFile } from './loadSaltFile' ;
2121import { generateConfigHash } from './utils' ;
2222
23- import { getSaltFilePath , attemptToReadTOMLData } from './utils' ;
23+ import { attemptToReadTOMLData } from './utils' ;
2424import type { Config } from './Config' ;
2525import Debug from 'debug' ;
2626const log = Debug ( 'CID:loadConfig' ) ;
@@ -35,10 +35,10 @@ type LoadConfigResult =
3535
3636
3737type LoadConfigInput = {
38- configPath : string ,
39- algorithmId : string ,
40- usingUI ?: boolean ,
41- validateConfig ?: boolean
38+ configPath : string ;
39+ algorithmId : string ;
40+ usingUI ?: boolean ;
41+ validateConfig ?: boolean ;
4242}
4343// Main entry point for loading a config file.
4444// returns:
@@ -96,6 +96,8 @@ export function loadConfig({ configPath, algorithmId, usingUI=false, validateCon
9696 configData . algorithm . columns . reference = configData . algorithm . columns . reference . sort ( ) ;
9797 configData . algorithm . columns . static = configData . algorithm . columns . static . sort ( ) ;
9898
99+ // TODO: check whether embedded salt file path is provided, config should override embedded.
100+
99101 // check if we need to inject the salt data into the config
100102 // if not, the config loading is finished
101103 if ( configData . algorithm . salt . source === 'STRING' ) {
@@ -122,15 +124,15 @@ export function loadConfig({ configPath, algorithmId, usingUI=false, validateCon
122124 return {
123125 success : false ,
124126 isSaltFileError : true ,
125- error : `Invalid salt file: '${ getSaltFilePath ( saltFilePath ) } '` ,
127+ error : `Invalid salt file: '${ saltFilePath } '` ,
126128 // send the existing config alongside so if this config is the backup one, error messages
127129 // can still be loaded
128130 config : configData ,
129131 } ;
130132 }
131133
132134 // replace the "FILE" with "STRING" amd embed the salt data
133- configData . algorithm . salt = configData . algorithm . salt as unknown as Config . CoreConfiguration [ "algorithm" ] [ "salt" ] ;
135+ configData . algorithm . salt = configData . algorithm . salt as unknown as Config . StringBasedSalt ;
134136 configData . algorithm . salt . source = 'STRING' ;
135137 configData . algorithm . salt . value = saltData ;
136138
0 commit comments