Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-11437] 1Password 1pux importer updates and fixes #10778

Merged
merged 6 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libs/importer/spec/onepassword-1pux-importer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ describe("1Password 1Pux Importer", () => {
const SecureNoteDataJson = JSON.stringify(SecureNoteData);
const SanitizedExportJson = JSON.stringify(SanitizedExport);

it("should not import items with state 'archived'", async () => {
const importer = new OnePassword1PuxImporter();
const archivedLoginData = LoginData;
archivedLoginData["accounts"][0]["vaults"][0]["items"][0]["state"] = "archived";
const archivedDataJson = JSON.stringify(archivedLoginData);
const result = await importer.parse(archivedDataJson);
expect(result != null).toBe(true);
expect(result.ciphers.length).toBe(0);
});

it("should parse login data", async () => {
const importer = new OnePassword1PuxImporter();
const result = await importer.parse(LoginDataJson);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const APICredentialsData: ExportData = {
favIndex: 0,
createdAt: 1619465969,
updatedAt: 1619466052,
trashed: false,
state: "active",
categoryUuid: "112",
details: {
loginFields: [],
Expand All @@ -41,7 +41,6 @@ export const APICredentialsData: ExportData = {
value: {
string: "[email protected]",
},
indexAtSource: 0,
guarded: true,
multiline: false,
dontGenerate: false,
Expand All @@ -57,7 +56,6 @@ export const APICredentialsData: ExportData = {
value: {
concealed: "apiapiapiapiapiapiappy",
},
indexAtSource: 1,
guarded: true,
multiline: false,
dontGenerate: true,
Expand All @@ -73,7 +71,6 @@ export const APICredentialsData: ExportData = {
value: {
menu: "jwt",
},
indexAtSource: 2,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -89,7 +86,6 @@ export const APICredentialsData: ExportData = {
value: {
string: "filename.jwt",
},
indexAtSource: 3,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -105,7 +101,6 @@ export const APICredentialsData: ExportData = {
value: {
date: 1301918460,
},
indexAtSource: 4,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -121,7 +116,6 @@ export const APICredentialsData: ExportData = {
value: {
date: 1932811260,
},
indexAtSource: 5,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -137,7 +131,6 @@ export const APICredentialsData: ExportData = {
value: {
string: "not.your.everyday.hostname",
},
indexAtSource: 6,
guarded: false,
multiline: false,
dontGenerate: false,
Expand Down
12 changes: 1 addition & 11 deletions libs/importer/spec/test-data/onepassword-1pux/bank-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const BankAccountData: ExportData = {
favIndex: 0,
createdAt: 1619466056,
updatedAt: 1619466187,
trashed: false,
state: "active",
categoryUuid: "101",
details: {
loginFields: [],
Expand All @@ -41,7 +41,6 @@ export const BankAccountData: ExportData = {
value: {
string: "Super Credit Union",
},
indexAtSource: 0,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -57,7 +56,6 @@ export const BankAccountData: ExportData = {
value: {
string: "Cool Guy",
},
indexAtSource: 1,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -73,7 +71,6 @@ export const BankAccountData: ExportData = {
value: {
menu: "checking",
},
indexAtSource: 2,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -89,7 +86,6 @@ export const BankAccountData: ExportData = {
value: {
string: "111000999",
},
indexAtSource: 3,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -105,7 +101,6 @@ export const BankAccountData: ExportData = {
value: {
string: "192837465918273645",
},
indexAtSource: 4,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -121,7 +116,6 @@ export const BankAccountData: ExportData = {
value: {
string: "123456",
},
indexAtSource: 5,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -137,7 +131,6 @@ export const BankAccountData: ExportData = {
value: {
string: "DE12 123456",
},
indexAtSource: 6,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -153,7 +146,6 @@ export const BankAccountData: ExportData = {
value: {
concealed: "5555",
},
indexAtSource: 7,
guarded: false,
multiline: false,
dontGenerate: true,
Expand All @@ -175,7 +167,6 @@ export const BankAccountData: ExportData = {
value: {
phone: "9399399933",
},
indexAtSource: 0,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -191,7 +182,6 @@ export const BankAccountData: ExportData = {
value: {
string: "1 Fifth Avenue",
},
indexAtSource: 1,
guarded: false,
multiline: false,
dontGenerate: false,
Expand Down
19 changes: 1 addition & 18 deletions libs/importer/spec/test-data/onepassword-1pux/credit-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const CreditCardData: ExportData = {
favIndex: 0,
createdAt: 1619465282,
updatedAt: 1619465447,
trashed: false,
state: "active",
categoryUuid: "002",
details: {
loginFields: [],
Expand All @@ -41,7 +41,6 @@ export const CreditCardData: ExportData = {
value: {
string: "Fred Engels",
},
indexAtSource: 0,
guarded: true,
multiline: false,
dontGenerate: false,
Expand All @@ -57,7 +56,6 @@ export const CreditCardData: ExportData = {
value: {
creditCardType: "discover",
},
indexAtSource: 1,
guarded: true,
multiline: false,
dontGenerate: false,
Expand All @@ -73,7 +71,6 @@ export const CreditCardData: ExportData = {
value: {
creditCardNumber: "6011111111111117",
},
indexAtSource: 2,
guarded: true,
clipboardFilter: "0123456789",
multiline: false,
Expand All @@ -90,7 +87,6 @@ export const CreditCardData: ExportData = {
value: {
concealed: "1312",
},
indexAtSource: 3,
guarded: true,
multiline: false,
dontGenerate: true,
Expand All @@ -106,7 +102,6 @@ export const CreditCardData: ExportData = {
value: {
monthYear: 209912,
},
indexAtSource: 4,
guarded: true,
multiline: false,
dontGenerate: false,
Expand All @@ -122,7 +117,6 @@ export const CreditCardData: ExportData = {
value: {
monthYear: 200101,
},
indexAtSource: 5,
guarded: true,
multiline: false,
dontGenerate: false,
Expand All @@ -138,7 +132,6 @@ export const CreditCardData: ExportData = {
value: {
string: "card",
},
indexAtSource: 6,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -160,7 +153,6 @@ export const CreditCardData: ExportData = {
value: {
string: "Some bank",
},
indexAtSource: 0,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -176,7 +168,6 @@ export const CreditCardData: ExportData = {
value: {
phone: "123456",
},
indexAtSource: 1,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -192,7 +183,6 @@ export const CreditCardData: ExportData = {
value: {
phone: "0800123456",
},
indexAtSource: 2,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -208,7 +198,6 @@ export const CreditCardData: ExportData = {
value: {
phone: "+49123456",
},
indexAtSource: 3,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -224,7 +213,6 @@ export const CreditCardData: ExportData = {
value: {
url: "somebank.com",
},
indexAtSource: 4,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -246,7 +234,6 @@ export const CreditCardData: ExportData = {
value: {
concealed: "1234",
},
indexAtSource: 0,
guarded: false,
multiline: false,
dontGenerate: true,
Expand All @@ -262,7 +249,6 @@ export const CreditCardData: ExportData = {
value: {
string: "$1312",
},
indexAtSource: 1,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -278,7 +264,6 @@ export const CreditCardData: ExportData = {
value: {
string: "$500",
},
indexAtSource: 2,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -294,7 +279,6 @@ export const CreditCardData: ExportData = {
value: {
string: "1%",
},
indexAtSource: 3,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -310,7 +294,6 @@ export const CreditCardData: ExportData = {
value: {
string: "123456",
},
indexAtSource: 4,
guarded: false,
multiline: false,
dontGenerate: false,
Expand Down
11 changes: 1 addition & 10 deletions libs/importer/spec/test-data/onepassword-1pux/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const DatabaseData: ExportData = {
favIndex: 0,
createdAt: 1619466193,
updatedAt: 1619466276,
trashed: false,
state: "active",
categoryUuid: "102",
details: {
loginFields: [],
Expand All @@ -41,7 +41,6 @@ export const DatabaseData: ExportData = {
value: {
menu: "postgresql",
},
indexAtSource: 0,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -57,7 +56,6 @@ export const DatabaseData: ExportData = {
value: {
string: "my.secret.db.server",
},
indexAtSource: 1,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -73,7 +71,6 @@ export const DatabaseData: ExportData = {
value: {
string: "1337",
},
indexAtSource: 2,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -89,7 +86,6 @@ export const DatabaseData: ExportData = {
value: {
string: "user_database",
},
indexAtSource: 3,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -105,7 +101,6 @@ export const DatabaseData: ExportData = {
value: {
string: "cooldbuser",
},
indexAtSource: 4,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -121,7 +116,6 @@ export const DatabaseData: ExportData = {
value: {
concealed: "^+kTjhLaN7wVPAhGU)*J",
},
indexAtSource: 5,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -137,7 +131,6 @@ export const DatabaseData: ExportData = {
value: {
string: "ASDIUFU-283234",
},
indexAtSource: 6,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -153,7 +146,6 @@ export const DatabaseData: ExportData = {
value: {
string: "cdbu",
},
indexAtSource: 7,
guarded: false,
multiline: false,
dontGenerate: false,
Expand All @@ -169,7 +161,6 @@ export const DatabaseData: ExportData = {
value: {
string: "ssh",
},
indexAtSource: 8,
guarded: false,
multiline: false,
dontGenerate: false,
Expand Down
Loading
Loading