diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index dd6d41d2bd..b24860f91f 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -9,7 +9,7 @@ import { ToasterModule } from 'angular2-toaster'; import { DesktopPlatformUtilsService } from '../../services/desktopPlatformUtils.service'; import { DesktopRendererMessagingService } from '../../services/desktopRendererMessaging.service'; -import { DesktopSecureStorageService } from '../../services/desktopSecureStorage.service'; +import { DesktopRendererSecureStorageService } from '../../services/desktopRendererSecureStorage.service'; import { DesktopStorageService } from '../../services/desktopStorage.service'; import { I18nService } from '../../services/i18n.service'; @@ -71,9 +71,9 @@ const platformUtilsService = new DesktopPlatformUtilsService(i18nService); const broadcasterService = new BroadcasterService(); const messagingService = new DesktopRendererMessagingService(broadcasterService); const storageService: StorageServiceAbstraction = new DesktopStorageService(); -const secureStorageService: StorageServiceAbstraction = new DesktopSecureStorageService(); +const secureStorageService: StorageServiceAbstraction = new DesktopRendererSecureStorageService(); const constantsService = new ConstantsService({}, 0); -const cryptoService = new CryptoService(storageService, storageService); // TODO: use secure storage +const cryptoService = new CryptoService(storageService, secureStorageService); const tokenService = new TokenService(storageService); const appIdService = new AppIdService(storageService); const apiService = new ApiService(tokenService, platformUtilsService, diff --git a/src/main/messaging.main.ts b/src/main/messaging.main.ts index caa203f7a9..9f804ca845 100644 --- a/src/main/messaging.main.ts +++ b/src/main/messaging.main.ts @@ -1,5 +1,5 @@ import { app, ipcMain } from 'electron'; -// import { getPassword, setPassword, deletePassword } from 'keytar'; +import { getPassword, setPassword, deletePassword } from 'keytar'; import { WindowMain } from './window.main'; @@ -15,7 +15,6 @@ export class MessagingMain { this.scheduleNextSync(); ipcMain.on('messagingService', async (event: any, message: any) => this.onMessage(message)); - /* ipcMain.on('keytar', async (event: any, message: any) => { try { let val: string = null; @@ -35,7 +34,6 @@ export class MessagingMain { event.returnValue = null; } }); - */ } onMessage(message: any) { diff --git a/src/services/desktopSecureStorage.service.ts b/src/services/desktopRendererSecureStorage.service.ts similarity index 91% rename from src/services/desktopSecureStorage.service.ts rename to src/services/desktopRendererSecureStorage.service.ts index 968e6bb0f8..615404d537 100644 --- a/src/services/desktopSecureStorage.service.ts +++ b/src/services/desktopRendererSecureStorage.service.ts @@ -1,7 +1,7 @@ import { ipcRenderer } from 'electron'; import { StorageService } from 'jslib/abstractions/storage.service'; -export class DesktopSecureStorageService implements StorageService { +export class DesktopRendererSecureStorageService implements StorageService { async get(key: string): Promise { const val = ipcRenderer.sendSync('keytar', { action: 'getPassword',