Skip to content

Backup and restore of Passwords#436

Open
AdityaMitra5102 wants to merge 17 commits into
Nitrokey:mainfrom
AdityaMitra5102:main
Open

Backup and restore of Passwords#436
AdityaMitra5102 wants to merge 17 commits into
Nitrokey:mainfrom
AdityaMitra5102:main

Conversation

@AdityaMitra5102

Copy link
Copy Markdown

Backup and Restore of passwords functionality added.

Known issue: Sometimes the 'Press Nitrokey prompt is not appearing'

@mmerklinger mmerklinger requested review from a team, daringer, james-knippes, mmerklinger, robin-nitrokey and sosthene-nitrokey and removed request for a team June 2, 2026 08:24
@mmerklinger mmerklinger linked an issue Jun 2, 2026 that may be closed by this pull request
@AdityaMitra5102

Copy link
Copy Markdown
Author

The Backup and Restore buttons look like this. The SVG icons are under MIT License from VMWare in SVG repo. Would that be ok?

image

@AdityaMitra5102

Copy link
Copy Markdown
Author

Moved backup and restore Logic to the SDK, with the logic in PR 126. Run against that branch to test

@AdityaMitra5102 AdityaMitra5102 requested a review from a team as a code owner June 23, 2026 13:00

@robin-nitrokey robin-nitrokey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! I’ve added some minor comments, questions and suggestions.

Comment thread nitrokeyapp/secrets_tab/backup_restore_ui.py Outdated
Comment thread nitrokeyapp/secrets_tab/backup_restore_ui.py Outdated
Comment thread nitrokeyapp/secrets_tab/backup_restore_ui.py Outdated
action_layout.addWidget(QLabel("Action:"))
action_layout.addWidget(self.action_edit)

self.cleartext_checkbox = QCheckBox("Cleartext")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to add tooltips to these fields that describe:

  • Cleartext: that this option disables encryption of the generated backup and is thus discouraged
  • Passphrase: that the passphrase is automatically generated when creating a backup
  • Failed and skipped: more details on when a credential ends up in this list

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.failed_name = "Not passwords" if name == BackupRestoreAction.BACKUP else "Already exists"

Failed is not shown as failed. During backup, failed means it is not a password credential. During restore failed means another credential with same label already exists on the key

@AdityaMitra5102 AdityaMitra5102 Jun 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleartext and passphrase tooltips added

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. For us it is clear what Not passwords means but I think without context it could be confusing. That’s why I’d also add a tooltip here, something like: Credentials without a password (for example OTP only) are skipped during the backup as they cannot be extracted from the device.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines +84 to +85
self.status_edit = QLineEdit()
self.status_edit.setReadOnly(True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using QStatusBar for this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

</property>
<property name="icon">
<iconset>
<normaloff>icons/backup.svg</normaloff>icons/backup.svg</iconset>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m a bit confused by the icons. I think originally the arrow pointing to the server is the backup icon and the arrow pointing from the server is the restore icon. You reversed that, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Because when I was making this UI, I was originally naming it 'Export' and 'Import', and my logic was 'export' means 'taking out of the box' and 'import' means 'putting it into the box'. I'll fix it

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should I rename the buttons to Export and Import? Because in Pynitrokey we are naming it export and import

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the icons

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it probably makes sense to use the same terms both in pynitrokey and nitrokey-app2. Do you have a preference?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer calling it export and import because we offer interoperability with other password managers too which support CXF

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the names

Comment thread nitrokeyapp/ui/secrets_tab.ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Backup and restore passwords

2 participants