1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 00:03:22 +00:00

[PM-3811] Passkeys unification (#2774)

* PM-3811 Unified passkeys view and moved both inside Login as an array of FIdo2Key

* PM-3811 Passkeys unification => updated cipher details view an helpers

* PM-3811 Updated passkeys creation date time format
This commit is contained in:
Federico Maccaroni
2023-09-22 11:55:35 -03:00
committed by GitHub
parent 6ef6cf5d84
commit a4a0d31fc6
28 changed files with 7367 additions and 5018 deletions

View File

@@ -15,7 +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;
Fido2Keys = obj.Fido2Keys?.Select(f => new Fido2Key(f, alreadyEncrypted)).ToList();
BuildDomainModel(this, obj, new HashSet<string>
{
"Username",
@@ -29,7 +29,7 @@ namespace Bit.Core.Models.Domain
public EncString Password { get; set; }
public DateTime? PasswordRevisionDate { get; set; }
public EncString Totp { get; set; }
public Fido2Key Fido2Key { get; set; }
public List<Fido2Key> Fido2Keys { get; set; }
public async Task<LoginView> DecryptAsync(string orgId)
{
@@ -47,9 +47,13 @@ namespace Bit.Core.Models.Domain
view.Uris.Add(await uri.DecryptAsync(orgId));
}
}
if (Fido2Key != null)
if (Fido2Keys != null)
{
view.Fido2Key = await Fido2Key.DecryptAsync(orgId);
view.Fido2Keys = new List<Fido2KeyView>();
foreach (var fido2Key in Fido2Keys)
{
view.Fido2Keys.Add(await fido2Key.DecryptAsync(orgId));
}
}
return view;
}
@@ -68,9 +72,9 @@ namespace Bit.Core.Models.Domain
{
l.Uris = Uris.Select(u => u.ToLoginUriData()).ToList();
}
if (Fido2Key != null)
if (Fido2Keys != null)
{
l.Fido2Key = Fido2Key.ToFido2KeyData();
l.Fido2Keys = Fido2Keys.Select(f => f.ToFido2KeyData()).ToList();
}
return l;
}