mirror of
https://github.com/bitwarden/browser
synced 2024-12-25 17:32:46 +01:00
Add support for enpass sensitive fields (#98)
This commit is contained in:
parent
2de8c5ed16
commit
5e24e396ab
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user