From 5e24e396ab9c1089dcb08f8e0e401ab610d3acc6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 29 Apr 2020 11:12:59 -0400 Subject: [PATCH] Add support for enpass sensitive fields (#98) --- src/importers/enpassJsonImporter.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/importers/enpassJsonImporter.ts b/src/importers/enpassJsonImporter.ts index e0a4634a99..82579a5a11 100644 --- a/src/importers/enpassJsonImporter.ts +++ b/src/importers/enpassJsonImporter.ts @@ -8,6 +8,7 @@ import { CipherView } from '../models/view/cipherView'; import { FolderView } from '../models/view/folderView'; import { CipherType } from '../enums/cipherType'; +import { FieldType } from '../enums/fieldType'; export class EnpassJsonImporter extends BaseImporter implements Importer { parse(data: string): ImportResult { @@ -78,7 +79,7 @@ export class EnpassJsonImporter extends BaseImporter implements Importer { } else if (field.type === 'url') { urls.push(field.value); } else { - this.processKvp(cipher, field.label, field.value); + this.processKvp(cipher, field.label, field.value, field.sensitive === 1 ? FieldType.Hidden : null); } }); cipher.login.uris = this.makeUriArray(urls); @@ -101,10 +102,10 @@ export class EnpassJsonImporter extends BaseImporter implements Importer { cipher.card.code = field.value; } else if (field.type === 'ccExpiry' && this.isNullOrWhitespace(cipher.card.expYear)) { if (!this.setCardExpiration(cipher, field.value)) { - this.processKvp(cipher, field.label, field.value); + this.processKvp(cipher, field.label, field.value, field.sensitive === 1 ? FieldType.Hidden : null); } } else { - this.processKvp(cipher, field.label, field.value); + this.processKvp(cipher, field.label, field.value, field.sensitive === 1 ? FieldType.Hidden : null); } }); } @@ -114,7 +115,7 @@ export class EnpassJsonImporter extends BaseImporter implements Importer { if (this.isNullOrWhitespace(field.value) || field.type === 'section') { return; } - this.processKvp(cipher, field.label, field.value); + this.processKvp(cipher, field.label, field.value, field.sensitive === 1 ? FieldType.Hidden : null); }); }