Commit Graph

71 Commits (master)

Author SHA1 Message Date
Nate Graham e8c2d5c2cf Reduce default size of main window
The main window is sort of excessively large right now. This commit
reduces it to a more reasonable size.
2021-12-19 15:46:06 +00:00
Nate Graham 94d3eb3c13 Focus password field by default on launch 2021-12-19 14:59:11 +00:00
Johan Ouwerkerk 183651ed7e fix: improve i18n for add account buttons
Previously the existing main action (toolbar) button lacked comments,
and the placeholder message button lacked i18n entirely.
2021-05-03 04:03:24 +00:00
Johan Ouwerkerk 8ddfdaba42 chore: simplify password unlocking via keyboard
Turns out it is not needed to check whether an action is enabled before
triggerin it: the trigger is automatically suppressed if the action is
not yet enabled.
2021-05-03 04:03:24 +00:00
Johan Ouwerkerk 75a167665b refactor: switch to page navigation from C++
Rework QML to use the ViewModel classes and use the C++ flow classes to
drive QML page navigation.
2021-05-03 04:03:24 +00:00
Johan Ouwerkerk 131e59aa3a refactor: move property assignments to main.qml
Ensure that all logic for property assignment is concentrated in
main.qml in preparation for the introduction of view model classes.
2021-05-03 04:03:24 +00:00
Johan Ouwerkerk 12e060923e refactor: UI (page) navigation from C++ code
An app::Navigation class is introduced with an API very similar to the
Kirigami.PageRouter in QML. This new class is responsible for pusing
populated view model classes from C++ into QML ownership and triggering
appropriate navigation events. On the QML side a signal handler
forwards these calls to the Kirigami.PageRouter to perform the actual
navigation in the UI.

This construct paves the way for moving state transition and related
logic out of QML and towards C++, since this logic is currently mostly
concerned with page navigation in Keysmith. Ultimately that transition
should make the QML (page) views more easily re-usable.
2021-05-03 04:03:24 +00:00
Johan Ouwerkerk 571afeacdf refactor: port navigation to Kirigami.PageRouter
Replace existing manual manipulation of the application page stack with
a more declarative setup using Kirigami.PageRouter. This change does
not yet address the control flow: pages are not yet properly decoupled.
2021-05-03 04:03:24 +00:00
Devin Lin e3564e3bd7 Add placeholder message when accounts list is empty 2021-03-05 18:23:15 +00:00
Devin Lin dcfa16025e Improve password form look 2021-02-28 18:38:02 +00:00
Johan Ouwerkerk ad4308793b fix: show an appropriate error when a provided password fails its challenge
With this change the user now gets appropriate error feedback when trying to unlock their accounts using an incorrect password.

Additionally password entry is temporarily suspended in the UI while key derivation (etc.) is in progress.
This should help convey the idea that "something is happening", or rather avoid the impression that "nothing happens" or "this is broken" when in fact key derivation may simply be slow depending on the machine.
2021-01-20 06:17:48 +00:00
Johan Ouwerkerk f25ae7ffda chore: update SPDX copyright to include Carl Schwan 2020-11-11 20:28:47 +01:00
Carl Schwan 57f13956b4 padding inline message 2020-11-11 20:15:53 +01:00
Carl Schwan d440689e99 fix: make Kirigami relayout the unlock accounts page with proper word wrapping for the banner text
This is a hack/work-around for a deficiency in Kirigami pending a proper fix upstream.

See-Also: https://invent.kde.org/frameworks/kirigami/-/merge_requests/159
2020-11-11 20:15:53 +01:00
Carl Schwan cda7ace071 Fix layout of UnlockAccounts page on mobile 2020-11-11 20:15:53 +01:00
Carl Schwan 5c5a7e1ca0 fix: make Kirigami relayout the password setup page with proper word wrapping for the banner text
This is a hack/work-around for a deficiency in Kirigami pending a proper fix upstream.

See-Also: https://invent.kde.org/frameworks/kirigami/-/merge_requests/159
2020-11-11 20:15:47 +01:00
Carl Schwan abd2319a34 Better keyboard navigation 2020-11-11 20:09:11 +01:00
Carl Schwan 74ca38d318 Refresh setup password screen 2020-11-11 20:09:11 +01:00
Carl Schwan 33e1be37eb Fix incorrect spacing between forms 2020-11-10 10:19:17 +01:00
Carl Schwan 9865863dbd Fix mobile UI for addAccount page 2020-11-10 10:17:43 +01:00
Johan Ouwerkerk 8d1a88b8df fix: make sure to display password setup page again when appropriate
The feature to accept accounts from the command line via otpauth:// URI inadvertently broke the initial password setup flow.
With this change password setup and unlocking should now work correctly again in all cases/flows.

Issues: #14
2020-11-09 19:20:08 +01:00
Johan Ouwerkerk bc91de7e5b feat: support receiving a new account via otpauth:// URI from the commandline in the UI
This change implements necessary control flow to pick up on accounts being passed to Keysmith via commandline options.

This change covers UX only for the happy flow case in which the received account is a valid otpauth:// URI.
If such an URI is passed to Keysmith, then the Add Account form is automatically pushed on the page stack and pre-populated with data received from the commandline.
With this UX, if the account is valid the user may either accept it immediately or tweak settings (most likely account name/issuer) to make it valid.

Issues: #7, #14
2020-10-30 13:27:32 +01:00
Johan Ouwerkerk b0bc89810e feat: add actions to dismiss/cancel the add account form
Users may now cancel adding an account and dismiss the page.
This change is particularly relevant in the context of an account that is being added via URI passed on the commandline: the user may now explicitly reject it.

Additionally quitting Keysmith from the add account form is now also supported, hidden behding a boolean flag.
This will be useful for the initial page when receiving an account via URI from the commandline: the user may reject the account and quit Keysmith via a single action.

Issues: #7, #14
2020-10-30 13:25:33 +01:00
Johan Ouwerkerk 92e92557fa feat: add a page to recover when an account turns out to be already used while adding it
This page is a bit of a bodge for the fact that the current Accounts model must be 'unlocked' before it can be used.
In turn, this means that it is not straightforward to check that an account is still 'available' when presenting the user with the option to add an account received via URI from the commandline.
The solution implemented here is to check and let the user recover after unlocking, if necessary.

Issues: #7, #14
2020-10-30 13:24:39 +01:00
Johan Ouwerkerk 72cfaee9bf feat: introduce a generic "error page" component
This new component can be used to inject an interstitial page, letting the user know something went wrong and allowing them to decide whether to continue or to quit Keysmith.
This is especially useful when Keysmith was launched automatically from some other context (i.e. another app) without the user necessarily being fully aware of it.

Issues: #7, #14
2020-10-27 18:59:03 +01:00
Johan Ouwerkerk 30e66ef978 refactor: support validating account names without checking account availability
With this change AccountNameValidator can now be used without having a functional Accounts model.
This allows the existing AddAccount page to be re-used for context without a valid Accounts model, e.g. when receiving accounts via URI from the commandline.

Issues: #7, #14
2020-10-27 18:08:31 +01:00
Johan Ouwerkerk 9288f041c8 refactor: add support for ValidatedAccountInput being passed in from outside of the add account forms.
With this change top-level QML code may pass a (populated) ValidatedAccountInput object to pre-populate fields in the add account forms.

Issues: #7, #14
2020-10-27 18:08:31 +01:00
Johan Ouwerkerk 2fcb0938d0 fix: disable visually hidden "add account" action on the accounts overview page
Previously a user could accidentally trigger an additional 'add account' action even when the action (button) was not visible in the UI.
This oversight is now fixed.
2020-09-15 20:41:07 +02:00
Johan Ouwerkerk fa4f6f651e feat: support configuring remaining TOTP token details
With this change both epoch and hash algoritm may now be configured for TOTP tokens.

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk e539f2cf22 feat: support configuring remaining HOTP token details
With this change both checksum and custom truncation may now be enabled for HOTP tokens.

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk 28211b7791 feat: rework token details UX in add account form
- Hide token details by default
 - Only show relevant token details depending on token type

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk b3984dd054 refactor: prepare code for reworking account details when adding new accounts
- Introduce re-usable account name + issuer form. This will help to support overriding account name/issuer when adding accounts via OTP token URI/QR code
 - Move common settings out of TokenDetailsForm into AddAccount.qml

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk 63033b568d refactor: introduce model class to collate validated input from add account forms (flow)
This change prepares the UI for supporting alternative and more complex flows for adding accounts.
All parameters are now collated into a single "validated input" object which is more convenient to pass around between views
This makes it possible to support back- and forth navigation between "basic" and "advanced/details" forms for adding accounts.

Additionally it provides a fundamental building block for adding alternative ways to add accounts (e.g. via OTP token URI/QR code).

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk 09df98d3a4 refactor: prepare AccountStorage for more complex tokens
With this the AccountStorage module now fully supports some HOTP/TOTP parameters which are uncommon (but still part of HOTP/TOTP specifications).

 - Better types for offset, tokenLength. Make this consistent throughout
 - Finish support for offset, checksum parameters for HOTP tokens in AccountStorage
 - Finish support for hashing algorithm, epoch parameters for TOTP tokens in AccountStorage
 - Better API for creating oath::Algorithm instances
 - Code formatting (break up long lines)

Issues: #7
2020-08-08 09:17:55 +02:00
Johan Ouwerkerk d358d8abcc feat: Support configuring the issuer when adding a new account in Keysmith.
With this change, issuers are now fully supported.

Resolves: #13
2020-07-23 18:24:13 +02:00
Johan Ouwerkerk 0d40912360 feat: Add basic support for account 'issuer' in Keysmith.
With this change account storage and model work with accounts for which an issuer is recorded.
This is a prerequisite for fully supporting otpauth:// URIs (necessary for QR code support) in Keysmith.

Issues: #7, #13
See-Also: https://github.com/google/google-authenticator/wiki/Key-Uri-Format
2020-07-23 18:24:13 +02:00
Johan Ouwerkerk 029754b97c Improve the visuals of the health indicator/life timer for TOTP tokens:
- Increase height
 - Make the left edge sit flush with the edge of the list item
 - Fix colour contrast when a list item is being highlighted (pressed/checked)
2020-05-31 16:44:04 +02:00
Johan Ouwerkerk 532f606142 Make sure to sort entries by account (name) in the overview list. 2020-05-31 16:44:04 +02:00
Johan Ouwerkerk 6182d26d6f Fix Android flood fill effect when pressing an account entry.
Turns out that SwipeListItem (and derivatives) absolutely must have an `id` value of `listItem`.
With this change the account list entries now display a proper flood fill effect when pressed on Android.
2020-05-27 23:35:06 +02:00
Johan Ouwerkerk 07108d9be6 Fix text colouring when the SwipeListItem is pressed (or checked).
With this change, the theme's "active text" colour should now be used for the pressed/checked state, resulting in better contrast.
2020-05-27 23:35:06 +02:00
Johan Ouwerkerk 077e0b82d7 Sort of fix broken SwipeListItem's on Android by setting an implicit height.
Also fix positioning of the health indicator rectangle (should be based off of the root SwipeListItem geometry).
2020-05-27 23:35:06 +02:00
Johan Ouwerkerk 2281b5a6e9 Fix stale UI when the app is resumed from suspend.
In some cases Keysmith may be suspended and animations/timers are no longer updated.
With this change, the application now detects when it is being 'woken' from suspend and refreshes the UI.
2020-05-26 21:29:42 +02:00
Johan Ouwerkerk d9d110ed96 Sort of fix labels running off the ends of pages and being clipped.
Simply impose a max width and enable word wrapping to get labels to trade width for height.
2020-05-26 21:25:52 +02:00
Johan Ouwerkerk bf67a42cb1 Rework account entry list delegate QML
- Refactor code to have delegates per account-type & simplify code
 - Rework layouting in terms of anchors
 - Fix positioning of account name and token labels to be vertically
   centered
 - Make health indicator/token life timer for TOTP accounts sit flush
   with the bottom of the TOTP delegate UI itself and extend along the
   whole width. This resolves issue #11
2020-04-30 17:08:45 +02:00
Johan Ouwerkerk 24de2abacf Add inline error message for account storage errors
Show an inline error message when an error occurs while loading or
otherwise manipulating the account storage.
2020-04-24 18:05:05 +02:00
Johan Ouwerkerk d048adf921 UI/UX to ask for the accounts password on start up
With this change Keysmith now prompts the user to either:

 - setup a new password
 - supply an existing password (if detected)

Additionally the organisation/structure of the QML is cleaned up a bit.
All QML pages are dedicated QML files and a few signals are introduced
to provide slightly better encapsulation/decouple interdependencies.
2020-04-23 19:00:36 +02:00
Johan Ouwerkerk dca55eee4b Ask for confirmation before removing accounts
This change provides a modal dialog to prompt for confirmation when the
user clicks the delete button.
2020-04-23 18:55:13 +02:00
Johan Ouwerkerk 567d9c3c97 Do not reuse QML account entry UI delegates.
Delegate recycling causes a bug when removing an account and then adding
it back: the old, stale UI for the account is reused instead of a new one.

In combination with 'alive' guard property on the UI for account entries,
this results in the account entry becoming frozen in the old stale state.
(Incorrect helath indicators, tokens that do not update and buttons that no
longer respond anymore.)
2020-04-10 14:11:12 +02:00
Johan Ouwerkerk 438e341000 Avoid operations on a possibly expired account object.
After triggering the removal of an account from storage in the UI, it may
be possible for the UI not to fully reflect this change for a while yet.
During this short time window, it is possible for an operation to occur on
an already deleted account object which is a use-after-free bug.

In particular signals from animations and timers in the QML UI might still
trigger which causes a slot to be invoked that accesses the underlying
account object.

This change introduces a guard property called 'alive' which is flipped
when the account removal operation is triggered. Slots are updated to
check for the alive status of the UI before proceeding with other logic.
2020-04-10 14:10:47 +02:00
Johan Ouwerkerk 41d94024c2 Add basic clipboard support for copying tokens 2020-04-04 11:35:43 +02:00