1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-31 22:51:28 +01:00

1password1pux importer can import json (#6049)

The .1pux-format is technically just a ziup-file that contain a file named `export.data`which is a json file.
These changes add support to upload either a 1pux or the export.data file directly.
The thought to change this came through the recent addtion of the ProtonPass importer.

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith 2023-09-19 11:05:05 +02:00 committed by GitHub
parent d21cc261e6
commit 98cfe1b806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ export class ImportCommand {
try {
let contents;
if (format === "1password1pux") {
if (format === "1password1pux" && filepath.endsWith(".1pux")) {
contents = await CliUtils.extractZipContent(filepath, "export.data");
} else if (format === "protonpass" && filepath.endsWith(".zip")) {
contents = await CliUtils.extractZipContent(filepath, "Proton Pass/data.json");

View File

@ -309,7 +309,7 @@ export class ImportComponent implements OnInit, OnDestroy {
}
private getFileContents(file: File): Promise<string> {
if (this.format === "1password1pux") {
if (this.format === "1password1pux" && file.name.endsWith(".1pux")) {
return this.extractZipContent(file, "export.data");
}
if (

View File

@ -12,7 +12,7 @@ export const featuredImportOptions = [
{ id: "keepass2xml", name: "KeePass 2 (xml)" },
{ id: "lastpasscsv", name: "LastPass (csv)" },
{ id: "safaricsv", name: "Safari and macOS (csv)" },
{ id: "1password1pux", name: "1Password (1pux)" },
{ id: "1password1pux", name: "1Password (1pux/json)" },
] as const;
export const regularImportOptions = [