Add Google Authenticator 2FA import#4
Open
immz4 wants to merge 4 commits intoFoundation-Devices:mainfrom
Open
Conversation
Add check to 2FA QR code scan for Google Auth export QR codes.
There was a problem hiding this comment.
Pull request overview
Adds support for importing Google Authenticator “migration” (export) QR codes by parsing the migration URI into multiple TOTP entries and providing a UI confirmation flow before bulk-importing them.
Changes:
- Detect and parse
otpauth-migration://offline?...QR codes into multiple TOTP accounts (protobuf + base64 decode). - Add “import multiple accounts” confirmation modal and callback plumbing to proceed/cancel.
- Add batch-import logic with label de-duplication/prefixing and supporting dependencies (prost/regex/base32/etc).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.lock | Adds/updates transitive deps to support migration parsing (prost/regex/url/etc). |
| apps/gui-app-authenticator/Cargo.toml | Adds new dependencies needed for migration parsing and import. |
| apps/gui-app-authenticator/ui/pages/main/page.slint | Shows a confirmation modal when a multi-account import is pending. |
| apps/gui-app-authenticator/ui/authenticator-callbacks.slint | Adds callbacks/properties for multi-import flow. |
| apps/gui-app-authenticator/src/main.rs | Detects migration QR codes, stores pending imports, and implements batch import/cancel callbacks. |
| apps/gui-app-authenticator/src/lib.rs | Exposes migration module and shared helpers (timestamp + import label generation). |
| apps/gui-app-authenticator/src/google_migration.rs | Implements migration URI parsing/decoding and converts payload entries to otpauth URLs. |
| apps/gui-app-authenticator/proto/google_auth_migration.proto | Defines protobuf schema for Google Auth migration payload. |
| apps/gui-app-authenticator/proto/google_auth_migration.rs | Generated protobuf Rust types used by prost decode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds check to 2FA QR code scan for Google Authenticator export QR codes. It also includes logic for importing multiple 2FA accounts, which can be later used with other import types.
Test suite
Every Google Authenticator QR code contains up to 10 accounts. If export size is larger than 10, multiple QR codes are generated (which can be sequentially scanned).
This QR contains 4 test accounts, one of them is a duplicate, so only three will be imported.
Tests results