mirror of
https://github.com/bitwarden/mobile
synced 2026-01-09 20:13:18 +00:00
[PM-4054] Rename Fido2Key to Fido2Credential (#2821)
* PM-4054 Renamed Fido2Key to Fido2Credential on the entire codebase * PM-4054 Renamed file Fido2KeyApi to Fido2CredentialApi
This commit is contained in:
committed by
GitHub
parent
bb2f1f0f5f
commit
f2936c95fa
@@ -5,7 +5,7 @@ using Bit.Core.Models.View;
|
||||
|
||||
namespace Bit.Core.Models.Domain
|
||||
{
|
||||
public class Fido2Key : Domain
|
||||
public class Fido2Credential : Domain
|
||||
{
|
||||
public static HashSet<string> EncryptableProperties => new HashSet<string>
|
||||
{
|
||||
@@ -22,9 +22,9 @@ namespace Bit.Core.Models.Domain
|
||||
nameof(Counter)
|
||||
};
|
||||
|
||||
public Fido2Key() { }
|
||||
public Fido2Credential() { }
|
||||
|
||||
public Fido2Key(Fido2KeyData data, bool alreadyEncrypted = false)
|
||||
public Fido2Credential(Fido2CredentialData data, bool alreadyEncrypted = false)
|
||||
{
|
||||
BuildDomainModel(this, data, EncryptableProperties, alreadyEncrypted);
|
||||
}
|
||||
@@ -41,14 +41,14 @@ namespace Bit.Core.Models.Domain
|
||||
public EncString UserName { get; set; }
|
||||
public EncString Counter { get; set; }
|
||||
|
||||
public async Task<Fido2KeyView> DecryptAsync(string orgId, SymmetricCryptoKey key = null)
|
||||
public async Task<Fido2CredentialView> DecryptAsync(string orgId, SymmetricCryptoKey key = null)
|
||||
{
|
||||
return await DecryptObjAsync(new Fido2KeyView(), this, EncryptableProperties, orgId, key);
|
||||
return await DecryptObjAsync(new Fido2CredentialView(), this, EncryptableProperties, orgId, key);
|
||||
}
|
||||
|
||||
public Fido2KeyData ToFido2KeyData()
|
||||
public Fido2CredentialData ToFido2CredentialData()
|
||||
{
|
||||
var data = new Fido2KeyData();
|
||||
var data = new Fido2CredentialData();
|
||||
BuildDataModel(this, data, EncryptableProperties);
|
||||
return data;
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace Bit.Core.Models.Domain
|
||||
{
|
||||
PasswordRevisionDate = obj.PasswordRevisionDate;
|
||||
Uris = obj.Uris?.Select(u => new LoginUri(u, alreadyEncrypted)).ToList();
|
||||
Fido2Keys = obj.Fido2Keys?.Select(f => new Fido2Key(f, alreadyEncrypted)).ToList();
|
||||
Fido2Credentials = obj.Fido2Credentials?.Select(f => new Fido2Credential(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 List<Fido2Key> Fido2Keys { get; set; }
|
||||
public List<Fido2Credential> Fido2Credentials { get; set; }
|
||||
|
||||
public async Task<LoginView> DecryptAsync(string orgId, SymmetricCryptoKey key = null)
|
||||
{
|
||||
@@ -47,12 +47,12 @@ namespace Bit.Core.Models.Domain
|
||||
view.Uris.Add(await uri.DecryptAsync(orgId, key));
|
||||
}
|
||||
}
|
||||
if (Fido2Keys != null)
|
||||
if (Fido2Credentials != null)
|
||||
{
|
||||
view.Fido2Keys = new List<Fido2KeyView>();
|
||||
foreach (var fido2Key in Fido2Keys)
|
||||
view.Fido2Credentials = new List<Fido2CredentialView>();
|
||||
foreach (var fido2Credential in Fido2Credentials)
|
||||
{
|
||||
view.Fido2Keys.Add(await fido2Key.DecryptAsync(orgId, key));
|
||||
view.Fido2Credentials.Add(await fido2Credential.DecryptAsync(orgId, key));
|
||||
}
|
||||
}
|
||||
return view;
|
||||
@@ -72,9 +72,9 @@ namespace Bit.Core.Models.Domain
|
||||
{
|
||||
l.Uris = Uris.Select(u => u.ToLoginUriData()).ToList();
|
||||
}
|
||||
if (Fido2Keys != null)
|
||||
if (Fido2Credentials != null)
|
||||
{
|
||||
l.Fido2Keys = Fido2Keys.Select(f => f.ToFido2KeyData()).ToList();
|
||||
l.Fido2Credentials = Fido2Credentials.Select(f => f.ToFido2CredentialData()).ToList();
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user