Skip to content

Commit

Permalink
[PS-1805] BEEEP: Renamed importers based on agreed naming-convention (#…
Browse files Browse the repository at this point in the history
…3978)

* Rename all importer related files

Renamed all files based on our naming convention which we decided on with https://github.com/bitwarden/adr/blob/master/decisions/0012-angular-filename-convention.md

* Removed entries from whitelist-capital-letters.txt

* Rename missing safeInCloud test data

* Fix broken import

* Renamed folders (removed capital letters)

* Fix filename of BitwardenCsvImporter

* Fix imports of onepassword mac/win importer tests

* Remove already renamed folders from whitelist

* Rename dashlaneImporters to dashlane

Rename the folder
Fix all the imports
Remove dashlaneImporters from white-list

* Rename keeperImporters to keeper

Rename the folder
Fix all the imports
Remove keeperImporters from white-list

* Rename onepasswordImporters to onepassword

Rename the folder
Fix all the imports
Remove onepasswordImporters from white-list

* Rename safeinCloud test data folder

* Fix onepassword importer type imports
  • Loading branch information
djsmith85 authored Nov 11, 2022
1 parent 235fb8f commit 0e78910
Show file tree
Hide file tree
Showing 141 changed files with 218 additions and 355 deletions.
137 changes: 0 additions & 137 deletions .github/whitelist-capital-letters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,11 @@
./apps/desktop/src/models/nativeMessaging
./apps/desktop/src/models/nativeMessaging/encryptedMessagePayloads
./apps/desktop/src/models/nativeMessaging/encryptedMessageResponses
./libs/common/spec/importers/testData
./libs/common/spec/importers/testData/bitwardenJson
./libs/common/spec/importers/testData/chromeCsv
./libs/common/spec/importers/testData/dashlaneCsv
./libs/common/spec/importers/testData/firefoxCsv
./libs/common/spec/importers/testData/keeperJson
./libs/common/spec/importers/testData/mykiCsv
./libs/common/spec/importers/testData/nordpassCsv
./libs/common/spec/importers/testData/onePassword1Pux
./libs/common/spec/importers/testData/onePasswordCsv
./libs/common/spec/importers/testData/safariCsv
./libs/common/spec/importers/testData/safeInCloud
./libs/common/spec/misc/logInStrategies
./libs/common/src/abstractions/fileDownload
./libs/common/src/abstractions/userVerification
./libs/common/src/abstractions/vaultTimeout
./libs/common/src/emailForwarders
./libs/common/src/importers/dashlaneImporters
./libs/common/src/importers/keeperImporters
./libs/common/src/importers/onepasswordImporters
./libs/common/src/misc/logInStrategies
./libs/common/src/services/userVerification
./libs/common/src/services/vaultTimeout
Expand Down Expand Up @@ -54,65 +39,6 @@
./libs/common/spec/misc/logInStrategies/apiLogIn.strategy.spec.ts
./libs/common/spec/misc/logInStrategies/passwordLogIn.strategy.spec.ts
./libs/common/spec/misc/logInStrategies/ssoLogIn.strategy.spec.ts
./libs/common/spec/importers/testData/safeInCloud/testData.xml.ts
./libs/common/spec/importers/testData/safariCsv/oldSimplePasswordData.csv.ts
./libs/common/spec/importers/testData/safariCsv/simplePasswordData.csv.ts
./libs/common/spec/importers/testData/keeperJson/testData.ts
./libs/common/spec/importers/testData/bitwardenJson/passwordProtected.json.ts
./libs/common/spec/importers/testData/onePassword1Pux/SoftwareLicense.ts
./libs/common/spec/importers/testData/onePassword1Pux/SecureNote.ts
./libs/common/spec/importers/testData/onePassword1Pux/Emailfield.ts
./libs/common/spec/importers/testData/onePassword1Pux/CreditCard.ts
./libs/common/spec/importers/testData/onePassword1Pux/LoginData.ts
./libs/common/spec/importers/testData/onePassword1Pux/WirelessRouter.ts
./libs/common/spec/importers/testData/onePassword1Pux/SanitizedExport.ts
./libs/common/spec/importers/testData/onePassword1Pux/Membership.ts
./libs/common/spec/importers/testData/onePassword1Pux/OutdoorLicense.ts
./libs/common/spec/importers/testData/onePassword1Pux/EmailAccount.ts
./libs/common/spec/importers/testData/onePassword1Pux/Password.ts
./libs/common/spec/importers/testData/onePassword1Pux/RewardsProgram.ts
./libs/common/spec/importers/testData/onePassword1Pux/EmailfieldOnIdentity_Prefilled.ts
./libs/common/spec/importers/testData/onePassword1Pux/EmailfieldOnIdentity.ts
./libs/common/spec/importers/testData/onePassword1Pux/DriversLicense.ts
./libs/common/spec/importers/testData/onePassword1Pux/Database.ts
./libs/common/spec/importers/testData/onePassword1Pux/Passport.ts
./libs/common/spec/importers/testData/onePassword1Pux/Onepux_example.ts
./libs/common/spec/importers/testData/onePassword1Pux/BankAccount.ts
./libs/common/spec/importers/testData/onePassword1Pux/MedicalRecord.ts
./libs/common/spec/importers/testData/onePassword1Pux/IdentityData.ts
./libs/common/spec/importers/testData/onePassword1Pux/Server.ts
./libs/common/spec/importers/testData/onePassword1Pux/APICredentials.ts
./libs/common/spec/importers/testData/onePassword1Pux/SSN.ts
./libs/common/spec/importers/testData/onePasswordCsv/creditCard.windows.csv.ts
./libs/common/spec/importers/testData/onePasswordCsv/creditCard.mac.csv.ts
./libs/common/spec/importers/testData/onePasswordCsv/multipleItems.windows.csv.ts
./libs/common/spec/importers/testData/onePasswordCsv/multipleItems.mac.csv.ts
./libs/common/spec/importers/testData/nordpassCsv/nordpass.secureNote.csv.ts
./libs/common/spec/importers/testData/dashlaneCsv/multiplePersonalInfo.csv.ts
./libs/common/spec/importers/testData/dashlaneCsv/personalInfo.csv.ts
./libs/common/spec/importers/testData/mykiCsv/UserIdCard.csv.ts
./libs/common/spec/importers/testData/mykiCsv/UserTwofa.csv.ts
./libs/common/spec/importers/testData/mykiCsv/UserNote.csv.ts
./libs/common/spec/importers/testData/mykiCsv/UserAccount.csv.ts
./libs/common/spec/importers/testData/mykiCsv/UserIdentity.csv.ts
./libs/common/spec/importers/testData/mykiCsv/UserCreditCard.csv.ts
./libs/common/spec/importers/testData/firefoxCsv/firefoxAccountsData.csv.ts
./libs/common/spec/importers/testData/firefoxCsv/simplePasswordData.csv.ts
./libs/common/spec/importers/fsecureFskImporter.spec.ts
./libs/common/spec/importers/safariCsvImporter.spec.ts
./libs/common/spec/importers/keeperJsonImporter.spec.ts
./libs/common/spec/importers/bitwardenPasswordProtectedImporter.spec.ts
./libs/common/spec/importers/dashlaneCsvImporter.spec.ts
./libs/common/spec/importers/nordpassCsvImporter.spec.ts
./libs/common/spec/importers/onepasswordWinCsvImporter.spec.ts
./libs/common/spec/importers/firefoxCsvImporter.spec.ts
./libs/common/spec/importers/onepassword1PuxImporter.spec.ts
./libs/common/spec/importers/onepasswordMacCsvImporter.spec.ts
./libs/common/spec/importers/lastpassCsvImporter.spec.ts
./libs/common/spec/importers/onepassword1PifImporter.spec.ts
./libs/common/spec/importers/keepass2XmlImporter.spec.ts
./libs/common/spec/importers/bitwardenJsonImporter.spec.ts
./libs/common/spec/importers/mykiCsvImporter.spec.ts
./libs/common/spec/web/services/webCryptoFunction.service.spec.ts
./libs/common/spec/shared/interceptConsole.ts
./libs/common/spec/models/view/passwordHistoryView.spec.ts
Expand Down Expand Up @@ -143,69 +69,6 @@
./libs/common/src/types/twoFactorResponse.ts
./libs/common/src/types/authResponse.ts
./libs/common/src/types/syncEventArgs.ts
./libs/common/src/importers/enpassJsonImporter.ts
./libs/common/src/importers/firefoxCsvImporter.ts
./libs/common/src/importers/rememBearCsvImporter.ts
./libs/common/src/importers/ascendoCsvImporter.ts
./libs/common/src/importers/passwordDragonXmlImporter.ts
./libs/common/src/importers/passkeepCsvImporter.ts
./libs/common/src/importers/gnomeJsonImporter.ts
./libs/common/src/importers/secureSafeCsvImporter.ts
./libs/common/src/importers/zohoVaultCsvImporter.ts
./libs/common/src/importers/dashlaneImporters/dashlaneCsvImporter.ts
./libs/common/src/importers/dashlaneImporters/types/dashlaneCsvTypes.ts
./libs/common/src/importers/dashlaneImporters/dashlaneJsonImporter.ts
./libs/common/src/importers/meldiumCsvImporter.ts
./libs/common/src/importers/safariCsvImporter.ts
./libs/common/src/importers/msecureCsvImporter.ts
./libs/common/src/importers/buttercupCsvImporter.ts
./libs/common/src/importers/kasperskyTxtImporter.ts
./libs/common/src/importers/baseImporter.ts
./libs/common/src/importers/keepassxCsvImporter.ts
./libs/common/src/importers/encryptrCsvImporter.ts
./libs/common/src/importers/passwordWalletTxtImporter.ts
./libs/common/src/importers/codebookCsvImporter.ts
./libs/common/src/importers/nordpassCsvImporter.ts
./libs/common/src/importers/avastJsonImporter.ts
./libs/common/src/importers/blurCsvImporter.ts
./libs/common/src/importers/safeInCloudXmlImporter.ts
./libs/common/src/importers/enpassCsvImporter.ts
./libs/common/src/importers/saferpassCsvImport.ts
./libs/common/src/importers/keeperImporters/types/keeperJsonTypes.ts
./libs/common/src/importers/keeperImporters/keeperCsvImporter.ts
./libs/common/src/importers/keeperImporters/keeperJsonImporter.ts
./libs/common/src/importers/fsecureFskImporter.ts
./libs/common/src/importers/clipperzHtmlImporter.ts
./libs/common/src/importers/keepass2XmlImporter.ts
./libs/common/src/importers/stickyPasswordXmlImporter.ts
./libs/common/src/importers/aviraCsvImporter.ts
./libs/common/src/importers/bitwardenPasswordProtectedImporter.ts
./libs/common/src/importers/avastCsvImporter.ts
./libs/common/src/importers/mykiCsvImporter.ts
./libs/common/src/importers/logMeOnceCsvImporter.ts
./libs/common/src/importers/upmCsvImporter.ts
./libs/common/src/importers/yotiCsvImporter.ts
./libs/common/src/importers/roboformCsvImporter.ts
./libs/common/src/importers/passwordBossJsonImporter.ts
./libs/common/src/importers/splashIdCsvImporter.ts
./libs/common/src/importers/passmanJsonImporter.ts
./libs/common/src/importers/bitwardenCsvImporter.ts
./libs/common/src/importers/lastpassCsvImporter.ts
./libs/common/src/importers/bitwardenJsonImporter.ts
./libs/common/src/importers/passwordAgentCsvImporter.ts
./libs/common/src/importers/passpackCsvImporter.ts
./libs/common/src/importers/truekeyCsvImporter.ts
./libs/common/src/importers/blackBerryCsvImporter.ts
./libs/common/src/importers/importError.ts
./libs/common/src/importers/padlockCsvImporter.ts
./libs/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes.ts
./libs/common/src/importers/onepasswordImporters/onepasswordMacCsvImporter.ts
./libs/common/src/importers/onepasswordImporters/cipherImportContext.ts
./libs/common/src/importers/onepasswordImporters/onepasswordWinCsvImporter.ts
./libs/common/src/importers/onepasswordImporters/onepasswordCsvImporter.ts
./libs/common/src/importers/onepasswordImporters/onepassword1PuxImporter.ts
./libs/common/src/importers/onepasswordImporters/onepassword1PifImporter.ts
./libs/common/src/importers/passwordSafeXmlImporter.ts
./libs/common/src/enums/kdfType.ts
./libs/common/src/enums/fileUploadType.ts
./libs/common/src/enums/cipherType.ts
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/tools/import-export/import.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUti
import { PolicyService } from "@bitwarden/common/abstractions/policy/policy.service.abstraction";
import { ImportOption, ImportType } from "@bitwarden/common/enums/importOptions";
import { PolicyType } from "@bitwarden/common/enums/policyType";
import { ImportError } from "@bitwarden/common/importers/importError";
import { ImportError } from "@bitwarden/common/importers/import-error";

import { FilePasswordPromptComponent } from "./file-password-prompt.component";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Substitute, SubstituteOf } from "@fluffy-spoon/substitute";

import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { BitwardenJsonImporter } from "@bitwarden/common/importers/bitwardenJsonImporter";
import { BitwardenJsonImporter } from "@bitwarden/common/importers/bitwarden-json-importer";

import { data as passwordProtectedData } from "./testData/bitwardenJson/passwordProtected.json";
import { data as passwordProtectedData } from "./test-data/bitwarden-json/password-protected.json";

describe("bitwarden json importer", () => {
let sut: BitwardenJsonImporter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { Substitute, Arg, SubstituteOf } from "@fluffy-spoon/substitute";
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { KdfType } from "@bitwarden/common/enums/kdfType";
import { BitwardenPasswordProtectedImporter } from "@bitwarden/common/importers/bitwardenPasswordProtectedImporter";
import { BitwardenPasswordProtectedImporter } from "@bitwarden/common/importers/bitwarden-password-protected-importer";
import { Utils } from "@bitwarden/common/misc/utils";
import { ImportResult } from "@bitwarden/common/models/domain/import-result";

import { data as emptyDecryptedData } from "./testData/bitwardenJson/empty.json";
import { data as emptyDecryptedData } from "./test-data/bitwarden-json/empty.json";

describe("BitwardenPasswordProtectedImporter", () => {
let importer: BitwardenPasswordProtectedImporter;
Expand Down
4 changes: 2 additions & 2 deletions libs/common/spec/importers/chrome-csv-importer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { CipherView } from "@bitwarden/common/models/view/cipher.view";
import { LoginUriView } from "@bitwarden/common/models/view/login-uri.view";
import { LoginView } from "@bitwarden/common/models/view/login.view";

import { data as androidData } from "./testData/chromeCsv/android-data.csv";
import { data as simplePasswordData } from "./testData/chromeCsv/simple-password-data.csv";
import { data as androidData } from "./test-data/chrome-csv/android-data.csv";
import { data as simplePasswordData } from "./test-data/chrome-csv/simple-password-data.csv";

const CipherData = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { CipherType } from "@bitwarden/common/enums/cipherType";
import { DashlaneCsvImporter as Importer } from "@bitwarden/common/importers/dashlaneImporters/dashlaneCsvImporter";

import { credentialsData } from "./testData/dashlaneCsv/credentials.csv";
import { identityData } from "./testData/dashlaneCsv/id.csv";
import { multiplePersonalInfoData } from "./testData/dashlaneCsv/multiplePersonalInfo.csv";
import { paymentsData } from "./testData/dashlaneCsv/payments.csv";
import { personalInfoData } from "./testData/dashlaneCsv/personalInfo.csv";
import { secureNoteData } from "./testData/dashlaneCsv/securenotes.csv";
import { DashlaneCsvImporter as Importer } from "@bitwarden/common/importers/dashlane/dashlane-csv-importer";

import { credentialsData } from "./test-data/dashlane-csv/credentials.csv";
import { identityData } from "./test-data/dashlane-csv/id.csv";
import { multiplePersonalInfoData } from "./test-data/dashlane-csv/multiple-personal-info.csv";
import { paymentsData } from "./test-data/dashlane-csv/payments.csv";
import { personalInfoData } from "./test-data/dashlane-csv/personal-info.csv";
import { secureNoteData } from "./test-data/dashlane-csv/securenotes.csv";

describe("Dashlane CSV Importer", () => {
let importer: Importer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FirefoxCsvImporter as Importer } from "@bitwarden/common/importers/firefoxCsvImporter";
import { FirefoxCsvImporter as Importer } from "@bitwarden/common/importers/firefox-csv-importer";
import { CipherView } from "@bitwarden/common/models/view/cipher.view";
import { LoginUriView } from "@bitwarden/common/models/view/login-uri.view";
import { LoginView } from "@bitwarden/common/models/view/login.view";

import { data as firefoxAccountsData } from "./testData/firefoxCsv/firefoxAccountsData.csv";
import { data as simplePasswordData } from "./testData/firefoxCsv/simplePasswordData.csv";
import { data as firefoxAccountsData } from "./test-data/firefox-csv/firefox-accounts-data.csv";
import { data as simplePasswordData } from "./test-data/firefox-csv/simple-password-data.csv";

const CipherData = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FSecureFskImporter as Importer } from "@bitwarden/common/importers/fsecureFskImporter";
import { FSecureFskImporter as Importer } from "@bitwarden/common/importers/fsecure-fsk-importer";

const TestDataWithStyleSetToWebsite: string = JSON.stringify({
data: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeePass2XmlImporter as Importer } from "@bitwarden/common/importers/keepass2XmlImporter";
import { KeePass2XmlImporter as Importer } from "@bitwarden/common/importers/keepass2-xml-importer";

const TestData = `<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<KeePassFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { KeeperJsonImporter as Importer } from "@bitwarden/common/importers/keeperImporters/keeperJsonImporter";
import { KeeperJsonImporter as Importer } from "@bitwarden/common/importers/keeper/keeper-json-importer";
import { Utils } from "@bitwarden/common/misc/utils";

import { testData as TestData } from "./testData/keeperJson/testData";
import { testData as TestData } from "./test-data/keeper-json/testdata.json";

describe("Keeper Json Importer", () => {
const testDataJson = JSON.stringify(TestData);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CipherType } from "@bitwarden/common/enums/cipherType";
import { FieldType } from "@bitwarden/common/enums/fieldType";
import { LastPassCsvImporter as Importer } from "@bitwarden/common/importers/lastpassCsvImporter";
import { LastPassCsvImporter as Importer } from "@bitwarden/common/importers/lastpass-csv-importer";
import { ImportResult } from "@bitwarden/common/models/domain/import-result";
import { CipherView } from "@bitwarden/common/models/view/cipher.view";
import { FieldView } from "@bitwarden/common/models/view/field.view";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { CipherType } from "@bitwarden/common/enums/cipherType";
import { MykiCsvImporter as Importer } from "@bitwarden/common/importers/mykiCsvImporter";
import { MykiCsvImporter as Importer } from "@bitwarden/common/importers/myki-csv-importer";
import { CipherView } from "@bitwarden/common/models/view/cipher.view";

import { userAccountData } from "./testData/mykiCsv/UserAccount.csv";
import { userCreditCardData } from "./testData/mykiCsv/UserCreditCard.csv";
import { userIdCardData } from "./testData/mykiCsv/UserIdCard.csv";
import { userIdentityData } from "./testData/mykiCsv/UserIdentity.csv";
import { userNoteData } from "./testData/mykiCsv/UserNote.csv";
import { userTwoFaData } from "./testData/mykiCsv/UserTwofa.csv";
import { userAccountData } from "./test-data/myki-csv/user-account.csv";
import { userCreditCardData } from "./test-data/myki-csv/user-credit-card.csv";
import { userIdCardData } from "./test-data/myki-csv/user-id-card.csv";
import { userIdentityData } from "./test-data/myki-csv/user-identity.csv";
import { userNoteData } from "./test-data/myki-csv/user-note.csv";
import { userTwoFaData } from "./test-data/myki-csv/user-twofa.csv";

function expectDriversLicense(cipher: CipherView) {
expect(cipher.type).toBe(CipherType.Identity);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { CipherType } from "@bitwarden/common/enums/cipherType";
import { SecureNoteType } from "@bitwarden/common/enums/secureNoteType";
import { NordPassCsvImporter as Importer } from "@bitwarden/common/importers/nordpassCsvImporter";
import { NordPassCsvImporter as Importer } from "@bitwarden/common/importers/nordpass-csv-importer";
import { CipherView } from "@bitwarden/common/models/view/cipher.view";
import { IdentityView } from "@bitwarden/common/models/view/identity.view";

import { data as creditCardData } from "./testData/nordpassCsv/nordpass.card.csv";
import { data as identityData } from "./testData/nordpassCsv/nordpass.identity.csv";
import { data as loginData } from "./testData/nordpassCsv/nordpass.login.csv";
import { data as secureNoteData } from "./testData/nordpassCsv/nordpass.secureNote.csv";
import { data as creditCardData } from "./test-data/nordpass-csv/nordpass.card.csv";
import { data as identityData } from "./test-data/nordpass-csv/nordpass.identity.csv";
import { data as loginData } from "./test-data/nordpass-csv/nordpass.login.csv";
import { data as secureNoteData } from "./test-data/nordpass-csv/nordpass.secure-note.csv";

const namesTestData = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FieldType } from "@bitwarden/common/enums/fieldType";
import { OnePassword1PifImporter as Importer } from "@bitwarden/common/importers/onepasswordImporters/onepassword1PifImporter";
import { OnePassword1PifImporter as Importer } from "@bitwarden/common/importers/onepassword/onepassword-1pif-importer";

const TestData: string =
"***aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee***\n" +
Expand Down
Loading

0 comments on commit 0e78910

Please sign in to comment.