1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-09 03:53:15 +00:00

PM-1575 Added non-discoverable passkeys to login UI

This commit is contained in:
Federico Maccaroni
2023-05-19 17:24:25 +03:00
parent b88c0ea61f
commit 2aeb9b6d31
10 changed files with 106 additions and 32 deletions

View File

@@ -1,7 +1,28 @@
namespace Bit.Core.Models.Api
using Bit.Core.Models.Domain;
using Bit.Core.Models.Export;
namespace Bit.Core.Models.Api
{
public class Fido2KeyApi
{
public Fido2KeyApi()
{
}
public Fido2KeyApi(Fido2Key fido2Key)
{
NonDiscoverableId = fido2Key.NonDiscoverableId?.EncryptedString;
KeyType = fido2Key.KeyType?.EncryptedString;
KeyAlgorithm = fido2Key.KeyAlgorithm?.EncryptedString;
KeyCurve = fido2Key.KeyCurve?.EncryptedString;
KeyValue = fido2Key.KeyValue?.EncryptedString;
RpId = fido2Key.RpId?.EncryptedString;
RpName = fido2Key.RpName?.EncryptedString;
UserHandle = fido2Key.UserHandle?.EncryptedString;
UserName = fido2Key.UserName?.EncryptedString;
Counter = fido2Key.Counter?.EncryptedString;
}
public string NonDiscoverableId { get; set; }
public string KeyType { get; set; } = Constants.DefaultFido2KeyType;
public string KeyAlgorithm { get; set; } = Constants.DefaultFido2KeyAlgorithm;

View File

@@ -15,6 +15,7 @@ namespace Bit.Core.Models.Domain
{
PasswordRevisionDate = obj.PasswordRevisionDate;
Uris = obj.Uris?.Select(u => new LoginUri(u, alreadyEncrypted)).ToList();
Fido2Key = obj.Fido2Key != null ? new Fido2Key(obj.Fido2Key, alreadyEncrypted) : null;
BuildDomainModel(this, obj, new HashSet<string>
{
"Username",

View File

@@ -30,7 +30,8 @@ namespace Bit.Core.Models.Request
Username = cipher.Login.Username?.EncryptedString,
Password = cipher.Login.Password?.EncryptedString,
PasswordRevisionDate = cipher.Login.PasswordRevisionDate,
Totp = cipher.Login.Totp?.EncryptedString
Totp = cipher.Login.Totp?.EncryptedString,
Fido2Key = cipher.Login.Fido2Key != null ? new Fido2KeyApi(cipher.Login.Fido2Key) : null
};
break;
case CipherType.Card:
@@ -74,19 +75,7 @@ namespace Bit.Core.Models.Request
};
break;
case CipherType.Fido2Key:
Fido2Key = new Fido2KeyApi
{
NonDiscoverableId = cipher.Fido2Key.NonDiscoverableId?.EncryptedString,
KeyType = cipher.Fido2Key.KeyType?.EncryptedString,
KeyAlgorithm = cipher.Fido2Key.KeyAlgorithm?.EncryptedString,
KeyCurve = cipher.Fido2Key.KeyCurve?.EncryptedString,
KeyValue = cipher.Fido2Key.KeyValue?.EncryptedString,
RpId = cipher.Fido2Key.RpId?.EncryptedString,
RpName = cipher.Fido2Key.RpName?.EncryptedString,
UserHandle = cipher.Fido2Key.UserHandle?.EncryptedString,
UserName = cipher.Fido2Key.UserName?.EncryptedString,
Counter = cipher.Fido2Key.Counter?.EncryptedString
};
Fido2Key = new Fido2KeyApi(cipher.Fido2Key);
break;
default:
break;