Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Add support for enpass sensitive fields (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Apr 29, 2020
1 parent 2de8c5e commit 5e24e39
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/importers/enpassJsonImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
});
}
Expand All @@ -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);
});
}

Expand Down

0 comments on commit 5e24e39

Please sign in to comment.