mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
importer fixes
This commit is contained in:
@@ -55,7 +55,9 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer {
|
|||||||
cipher.type = CipherType.Card;
|
cipher.type = CipherType.Card;
|
||||||
cipher.card = new CardView();
|
cipher.card = new CardView();
|
||||||
}
|
}
|
||||||
|
if (cipher.type === CipherType.Login && !this.isNullOrWhitespace(item.details.password)) {
|
||||||
|
cipher.login.password = item.details.password;
|
||||||
|
}
|
||||||
if (!this.isNullOrWhitespace(item.details.notesPlain)) {
|
if (!this.isNullOrWhitespace(item.details.notesPlain)) {
|
||||||
cipher.notes = item.details.notesPlain.split(this.newLineRegex).join('\n') + '\n';
|
cipher.notes = item.details.notesPlain.split(this.newLineRegex).join('\n') + '\n';
|
||||||
}
|
}
|
||||||
@@ -91,6 +93,22 @@ export class OnePassword1PifImporter extends BaseImporter implements Importer {
|
|||||||
if (!this.isNullOrWhitespace(item.secureContents.notesPlain)) {
|
if (!this.isNullOrWhitespace(item.secureContents.notesPlain)) {
|
||||||
cipher.notes = item.secureContents.notesPlain.split(this.newLineRegex).join('\n') + '\n';
|
cipher.notes = item.secureContents.notesPlain.split(this.newLineRegex).join('\n') + '\n';
|
||||||
}
|
}
|
||||||
|
if (cipher.type === CipherType.Login) {
|
||||||
|
if (!this.isNullOrWhitespace(item.secureContents.password)) {
|
||||||
|
cipher.login.password = item.secureContents.password;
|
||||||
|
}
|
||||||
|
if (item.secureContents.URLs != null) {
|
||||||
|
const urls: string[] = [];
|
||||||
|
item.secureContents.URLs.forEach((u: any) => {
|
||||||
|
if (!this.isNullOrWhitespace(u.url)) {
|
||||||
|
urls.push(u.url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (urls.length > 0) {
|
||||||
|
cipher.login.uris = this.makeUriArray(urls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (item.secureContents.fields != null) {
|
if (item.secureContents.fields != null) {
|
||||||
this.parseFields(item.secureContents.fields, cipher, 'designation', 'value', 'name');
|
this.parseFields(item.secureContents.fields, cipher, 'designation', 'value', 'name');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,29 @@ export class RoboFormCsvImporter extends BaseImporter implements Importer {
|
|||||||
cipher.login.username = this.getValueOrDefault(value.Login);
|
cipher.login.username = this.getValueOrDefault(value.Login);
|
||||||
cipher.login.password = this.getValueOrDefault(value.Pwd);
|
cipher.login.password = this.getValueOrDefault(value.Pwd);
|
||||||
cipher.login.uris = this.makeUriArray(value.Url);
|
cipher.login.uris = this.makeUriArray(value.Url);
|
||||||
|
|
||||||
|
if (!this.isNullOrWhitespace(value.Rf_fields)) {
|
||||||
|
let fields: string[] = [value.Rf_fields];
|
||||||
|
if (value.__parsed_extra != null && value.__parsed_extra.length > 0) {
|
||||||
|
fields = fields.concat(value.__parsed_extra);
|
||||||
|
}
|
||||||
|
fields.forEach((field: string) => {
|
||||||
|
const parts = field.split(':');
|
||||||
|
if (parts.length < 3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const key = parts[0] === '-no-name-' ? null : parts[0];
|
||||||
|
const val = parts.length === 4 && parts[2] === 'rck' ? parts[1] : parts[2];
|
||||||
|
this.processKvp(cipher, key, val);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.cleanupCipher(cipher);
|
this.cleanupCipher(cipher);
|
||||||
|
|
||||||
if (i === results.length && cipher.name === '--' && this.isNullOrWhitespace(cipher.login.password)) {
|
if (i === results.length && cipher.name === '--' && this.isNullOrWhitespace(cipher.login.password)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.ciphers.push(cipher);
|
result.ciphers.push(cipher);
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user