From ea81acb3bfaeb9fa416f2831b6ebd2bf4ae0baa4 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Wed, 26 Jul 2023 17:59:49 -0300 Subject: [PATCH] [PM-1575] Display Passkeys (#2523) * PM-1575 Added new models for Fido2Key * PM-1575 Added discoverable passkeys and WIP non-discoverable ones * PM-1575 Fix format * PM-1575 Added non-discoverable passkeys to login UI * PM-1575 Added copy application icon to Fido2Key UI * PM-1575 Updated bwi font with the updated passkey icon * PM-1575 For now just display Available for two-step login on non-discoverable passkey inside of a cipher login * PM-1575 Fix non-discoverable passkey visibility * PM-1575 remove Passkeys as a filter in the vault list * PM-1575 Display error toast if there is a duplicate passkey when moving a cipher to an org * Revert "PM-1575 Display error toast if there is a duplicate passkey when moving a cipher to an org" This reverts commit 78e635360203541a9e45f5419a1ecc8c0a0cb1d4. * [PM-2378] Display error toast on duplicate Passkey when moving cipher to an organization (#2594) * PM-2378 Display error toast if there is a duplicate passkey when moving a cipher to an org * PM-3097 Fix issue when moving cipher with passkey to an org where the uniqueness should be taken into consideration on different passkeys types and also the Username (#2632) * PM-3096 Fix non-discoverable passkey to be taken into account when encrypting a cipher which was causing the passkey to be removed when moving to an org (#2637) --- src/Android/Assets/bwi-font.ttf | Bin 72280 -> 76108 bytes .../CipherViewCell/CipherViewCellViewModel.cs | 4 +- src/App/Pages/Vault/BaseCipherViewModel.cs | 2 + src/App/Pages/Vault/CipherAddEditPage.xaml | 43 +++++++++ .../Pages/Vault/CipherAddEditPageViewModel.cs | 8 +- src/App/Pages/Vault/CipherDetailsPage.xaml | 70 +++++++++++++- src/App/Pages/Vault/CipherDetailsPage.xaml.cs | 20 +--- .../Pages/Vault/CipherDetailsPageViewModel.cs | 37 ++++++- .../GroupingsPage/GroupingsPageListItem.cs | 6 ++ .../GroupingsPage/GroupingsPageViewModel.cs | 52 ++++------ src/App/Pages/Vault/SharePage.xaml | 2 +- src/App/Pages/Vault/SharePage.xaml.cs | 13 --- src/App/Pages/Vault/SharePageViewModel.cs | 17 +++- src/App/Resources/AppResources.Designer.cs | 91 ++++++++++++++++++ src/App/Resources/AppResources.resx | 31 ++++++ src/App/Utilities/AppHelpers.cs | 18 +++- src/App/Utilities/IconGlyphExtensions.cs | 19 ++-- src/App/Utilities/IconImageConverter.cs | 49 +++++++--- src/Core/Abstractions/ICipherService.cs | 8 +- src/Core/BitwardenIcons.cs | 1 + src/Core/Constants.cs | 3 + src/Core/Enums/CipherType.cs | 3 +- src/Core/Models/Api/Fido2KeyApi.cs | 37 +++++++ src/Core/Models/Api/LoginApi.cs | 1 + src/Core/Models/Data/CipherData.cs | 10 +- src/Core/Models/Data/Fido2KeyData.cs | 34 +++++++ src/Core/Models/Data/LoginData.cs | 2 + src/Core/Models/Domain/Cipher.cs | 15 ++- src/Core/Models/Domain/Fido2Key.cs | 54 +++++++++++ src/Core/Models/Domain/Login.cs | 10 ++ src/Core/Models/Request/CipherRequest.cs | 7 +- src/Core/Models/Response/CipherResponse.cs | 2 + src/Core/Models/View/CipherView.cs | 12 ++- src/Core/Models/View/Fido2KeyView.cs | 26 +++++ src/Core/Models/View/ILaunchableView.cs | 8 ++ src/Core/Models/View/LoginUriView.cs | 2 +- src/Core/Models/View/LoginView.cs | 2 + src/Core/Services/CipherService.cs | 62 +++++++++--- src/Core/Utilities/CipherTypeExtensions.cs | 14 +++ src/iOS.Autofill/Resources/bwi-font.ttf | Bin 72280 -> 76108 bytes src/iOS.Extension/Resources/bwi-font.ttf | Bin 72668 -> 76108 bytes src/iOS/Resources/bwi-font.ttf | Bin 72280 -> 76108 bytes 42 files changed, 664 insertions(+), 131 deletions(-) create mode 100644 src/Core/Models/Api/Fido2KeyApi.cs create mode 100644 src/Core/Models/Data/Fido2KeyData.cs create mode 100644 src/Core/Models/Domain/Fido2Key.cs create mode 100644 src/Core/Models/View/Fido2KeyView.cs create mode 100644 src/Core/Models/View/ILaunchableView.cs create mode 100644 src/Core/Utilities/CipherTypeExtensions.cs diff --git a/src/Android/Assets/bwi-font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52kF5Z z&zyR;KD9V?^ZBQq|6#x}F!;jnhdzDr_hL8-(Tb EZ&78Iga7~l diff --git a/src/App/Controls/CipherViewCell/CipherViewCellViewModel.cs b/src/App/Controls/CipherViewCell/CipherViewCellViewModel.cs index ea21df7dc..b5150b003 100644 --- a/src/App/Controls/CipherViewCell/CipherViewCellViewModel.cs +++ b/src/App/Controls/CipherViewCell/CipherViewCellViewModel.cs @@ -31,7 +31,7 @@ namespace Bit.App.Controls public bool ShowIconImage { get => WebsiteIconsEnabled - && !string.IsNullOrWhiteSpace(Cipher.Login?.Uri) + && !string.IsNullOrWhiteSpace(Cipher.LaunchUri) && IconImageSource != null; } @@ -41,7 +41,7 @@ namespace Bit.App.Controls { if (_iconImageSource == string.Empty) // default value since icon source can return null { - _iconImageSource = IconImageHelper.GetLoginIconImage(Cipher); + _iconImageSource = IconImageHelper.GetIconImage(Cipher); } return _iconImageSource; } diff --git a/src/App/Pages/Vault/BaseCipherViewModel.cs b/src/App/Pages/Vault/BaseCipherViewModel.cs index 871d8aa24..9cbfe7e83 100644 --- a/src/App/Pages/Vault/BaseCipherViewModel.cs +++ b/src/App/Pages/Vault/BaseCipherViewModel.cs @@ -37,6 +37,8 @@ namespace Bit.App.Pages set => SetProperty(ref _cipher, value, additionalPropertyNames: AdditionalPropertiesToRaiseOnCipherChanged); } + public string CreationDate => string.Format(AppResources.CreatedX, Cipher.CreationDate.ToShortDateString()); + public AsyncCommand CheckPasswordCommand { get; } protected async Task CheckPasswordAsync() diff --git a/src/App/Pages/Vault/CipherAddEditPage.xaml b/src/App/Pages/Vault/CipherAddEditPage.xaml index 552a5ac02..453da9146 100644 --- a/src/App/Pages/Vault/CipherAddEditPage.xaml +++ b/src/App/Pages/Vault/CipherAddEditPage.xaml @@ -223,6 +223,17 @@ AutomationId="RegeneratePasswordButton" /> +