add supprot for encrypted json export (#607)

* add supprot for encrypted json export

* fix lint issues
This commit is contained in:
Kyle Spearrin 2020-12-08 12:09:31 -05:00 committed by GitHub
parent ee1baf7fe3
commit 2bfba0be5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 6 deletions

2
jslib

@ -1 +1 @@
Subproject commit c9df039fa9f392462130b733b4a724a024672866
Subproject commit dcbd09e736b516b359369f9d9fe5b0f5a6c2a928

View File

@ -69,7 +69,7 @@ export class SettingsComponent implements OnInit {
private stateService: StateService, private messagingService: MessagingService,
private userService: UserService, private cryptoService: CryptoService) {
const isMac = this.platformUtilsService.getDevice() === DeviceType.MacOsDesktop;
const trayKey = isMac ? 'enableMenuBar' : 'enableTray';
this.enableTrayText = this.i18nService.t(trayKey);
this.enableTrayDescText = this.i18nService.t(trayKey + 'Desc');
@ -85,7 +85,7 @@ export class SettingsComponent implements OnInit {
const startToTrayKey = isMac ? 'startToMenuBar' : 'startToTray';
this.startToTrayText = this.i18nService.t(startToTrayKey)
this.startToTrayDescText = this.i18nService.t(startToTrayKey + 'Desc');
this.vaultTimeouts = [
// { name: i18nService.t('immediately'), value: 0 },
{ name: i18nService.t('oneMinute'), value: 1 },
@ -144,7 +144,8 @@ export class SettingsComponent implements OnInit {
const pinSet = await this.vaultTimeoutService.isPinLockSet();
this.pin = pinSet[0] || pinSet[1];
this.disableFavicons = await this.storageService.get<boolean>(ConstantsService.disableFaviconKey);
this.enableBrowserIntegration = await this.storageService.get<boolean>(ElectronConstants.enableBrowserIntegration);
this.enableBrowserIntegration = await this.storageService.get<boolean>(
ElectronConstants.enableBrowserIntegration);
this.enableMinToTray = await this.storageService.get<boolean>(ElectronConstants.enableMinimizeToTrayKey);
this.enableCloseToTray = await this.storageService.get<boolean>(ElectronConstants.enableCloseToTrayKey);
this.enableTray = await this.storageService.get<boolean>(ElectronConstants.enableTrayKey);
@ -317,7 +318,8 @@ export class SettingsComponent implements OnInit {
async saveBrowserIntegration() {
await this.storageService.save(ElectronConstants.enableBrowserIntegration, this.enableBrowserIntegration);
this.messagingService.send(this.enableBrowserIntegration ? 'enableBrowserIntegration' : 'disableBrowserIntegration');
this.messagingService.send(
this.enableBrowserIntegration ? 'enableBrowserIntegration' : 'disableBrowserIntegration');
}
private callAnalytics(name: string, enabled: boolean) {

View File

@ -12,6 +12,7 @@
<select id="format" name="Format" [(ngModel)]="format">
<option value="json">.json</option>
<option value="csv">.csv</option>
<option value="encrypted_json">.json (Encrypted)</option>
</select>
</div>
<div class="box-content-row box-content-row-flex" appBoxRow>
@ -32,7 +33,13 @@
</div>
<div class="box-footer">
<p>{{'exportMasterPassword' | i18n}}</p>
<strong>{{'warning' | i18n}}</strong>: {{'exportWarningDesc' | i18n}}
<strong>{{'warning' | i18n}}</strong>:
<span *ngIf="!encryptedFormat">
{{'exportWarningDesc' | i18n}}
</span>
<span *ngIf="encryptedFormat">
{{'encExportWarningDesc' | i18n}}
</span>
</div>
</div>
</div>

View File

@ -1215,6 +1215,9 @@
"exportWarningDesc": {
"message": "This export contains your vault data in an unencrypted format. You should not store or send the exported file over unsecure channels (such as email). Delete it immediately after you are done using it."
},
"encExportWarningDesc": {
"message": "This export encrypts your data using your account's encryption key. If you ever rotate your account's encryption key you should export again since you will not be able to decrypt this export file."
},
"exportMasterPassword": {
"message": "Enter your master password to export your vault data."
},