mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-02 08:40:08 +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 { FolderView } from '../models/view/folderView';
|
||||||
|
|
||||||
import { CipherType } from '../enums/cipherType';
|
import { CipherType } from '../enums/cipherType';
|
||||||
|
import { FieldType } from '../enums/fieldType';
|
||||||
|
|
||||||
export class EnpassJsonImporter extends BaseImporter implements Importer {
|
export class EnpassJsonImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): ImportResult {
|
parse(data: string): ImportResult {
|
||||||
@ -78,7 +79,7 @@ export class EnpassJsonImporter extends BaseImporter implements Importer {
|
|||||||
} else if (field.type === 'url') {
|
} else if (field.type === 'url') {
|
||||||
urls.push(field.value);
|
urls.push(field.value);
|
||||||
} else {
|
} 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);
|
cipher.login.uris = this.makeUriArray(urls);
|
||||||
@ -101,10 +102,10 @@ export class EnpassJsonImporter extends BaseImporter implements Importer {
|
|||||||
cipher.card.code = field.value;
|
cipher.card.code = field.value;
|
||||||
} else if (field.type === 'ccExpiry' && this.isNullOrWhitespace(cipher.card.expYear)) {
|
} else if (field.type === 'ccExpiry' && this.isNullOrWhitespace(cipher.card.expYear)) {
|
||||||
if (!this.setCardExpiration(cipher, field.value)) {
|
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 {
|
} 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') {
|
if (this.isNullOrWhitespace(field.value) || field.type === 'section') {
|
||||||
return;
|
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