SEARCH-440

- Removed the hard-coded version in crypto
This commit is contained in:
Keerthi Niranjan 2017-11-27 18:49:23 +05:30
parent 3312e49e75
commit bf537d3902

View File

@ -13,10 +13,9 @@ const DUMP_PATH = isDevEnv ? path.join(__dirname, '..', '..') : searchConfig.FOL
class Crypto { class Crypto {
constructor(userId, key) { constructor(userId, key) {
let INDEX_VERSION = 'v1';
this.indexDataFolder = searchConfig.FOLDERS_CONSTANTS.PREFIX_NAME_PATH + this.indexDataFolder = searchConfig.FOLDERS_CONSTANTS.PREFIX_NAME_PATH +
'_' + userId + '_' + searchConfig.INDEX_VERSION; '_' + userId + '_' + searchConfig.INDEX_VERSION;
this.permanentIndexName = searchConfig.FOLDERS_CONSTANTS.PREFIX_NAME + '_' + userId + '_' + INDEX_VERSION; this.permanentIndexName = searchConfig.FOLDERS_CONSTANTS.PREFIX_NAME + '_' + userId + '_' + searchConfig.INDEX_VERSION;
this.dump = DUMP_PATH; this.dump = DUMP_PATH;
this.key = key; this.key = key;
this.encryptedIndex = `${DUMP_PATH}/${this.permanentIndexName}.enc`; this.encryptedIndex = `${DUMP_PATH}/${this.permanentIndexName}.enc`;