1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

[PM-14627] Import TOTP with ZohoVault CSV importer (#11912)

* totp secret is assigned to cipher object in zohovalut-csv-importer to populate when importing keys from zoho vault fixes #11872 closes #11872

* fixed issue#11872

* assigned full totp url to cipher object and also implemented unit tests for zohovault importer

* Add test to when no data is passed to the importer

* Fix import of folders

- Replace "Chambername" with "Folder Name"
- Add tests for importing folders and collections

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
This commit is contained in:
SHASHI KUMAR KASTURI
2024-11-12 12:47:25 -05:00
committed by GitHub
parent 40f2e15cec
commit aa04d84c11
3 changed files with 95 additions and 2 deletions

View File

@@ -13,7 +13,6 @@ export class ZohoVaultCsvImporter extends BaseImporter implements Importer {
result.success = false;
return Promise.resolve(result);
}
results.forEach((value) => {
if (
this.isNullOrWhitespace(value["Password Name"]) &&
@@ -21,7 +20,7 @@ export class ZohoVaultCsvImporter extends BaseImporter implements Importer {
) {
return;
}
this.processFolder(result, this.getValueOrDefault(value.ChamberName));
this.processFolder(result, this.getValueOrDefault(value["Folder Name"]));
const cipher = this.initLoginCipher();
cipher.favorite = this.getValueOrDefault(value.Favorite, "0") === "1";
cipher.notes = this.getValueOrDefault(value.Notes);
@@ -32,6 +31,7 @@ export class ZohoVaultCsvImporter extends BaseImporter implements Importer {
cipher.login.uris = this.makeUriArray(
this.getValueOrDefault(value["Password URL"], this.getValueOrDefault(value["Secret URL"])),
);
cipher.login.totp = this.getValueOrDefault(value["login_totp"]);
this.parseData(cipher, value.SecretData);
this.parseData(cipher, value.CustomData);
this.convertToNoteIfNeeded(cipher);