mirror of
https://github.com/bitwarden/mobile
synced 2026-01-09 20:13:18 +00:00
Password reprompt (#1365)
* Make card number hidden * Add support for password reprompt * Rename PasswordPrompt to Reprompt * Protect autofill * Use Enums.CipherRepromptType * Fix iOS not building * Protect iOS autofill * Update to match jslib * Fix failing build
This commit is contained in:
@@ -25,6 +25,7 @@ namespace Bit.Core.Models.Data
|
||||
Name = response.Name;
|
||||
Notes = response.Notes;
|
||||
CollectionIds = collectionIds?.ToList() ?? response.CollectionIds;
|
||||
Reprompt = response.Reprompt;
|
||||
|
||||
try // Added to address Issue (https://github.com/bitwarden/mobile/issues/1006)
|
||||
{
|
||||
@@ -84,5 +85,6 @@ namespace Bit.Core.Models.Data
|
||||
public List<PasswordHistoryData> PasswordHistory { get; set; }
|
||||
public List<string> CollectionIds { get; set; }
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public Enums.CipherRepromptType Reprompt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Models.View;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -30,6 +31,7 @@ namespace Bit.Core.Models.Domain
|
||||
RevisionDate = obj.RevisionDate;
|
||||
CollectionIds = obj.CollectionIds != null ? new HashSet<string>(obj.CollectionIds) : null;
|
||||
LocalData = localData;
|
||||
Reprompt = obj.Reprompt;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
@@ -75,8 +77,8 @@ namespace Bit.Core.Models.Domain
|
||||
public List<Field> Fields { get; set; }
|
||||
public List<PasswordHistory> PasswordHistory { get; set; }
|
||||
public HashSet<string> CollectionIds { get; set; }
|
||||
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
|
||||
public async Task<CipherView> DecryptAsync()
|
||||
{
|
||||
@@ -167,7 +169,8 @@ namespace Bit.Core.Models.Domain
|
||||
RevisionDate = RevisionDate,
|
||||
Type = Type,
|
||||
CollectionIds = CollectionIds.ToList(),
|
||||
DeletedDate = DeletedDate
|
||||
DeletedDate = DeletedDate,
|
||||
Reprompt = Reprompt,
|
||||
};
|
||||
BuildDataModel(this, c, new HashSet<string>
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace Bit.Core.Models.Request
|
||||
Notes = cipher.Notes?.EncryptedString;
|
||||
Favorite = cipher.Favorite;
|
||||
LastKnownRevisionDate = cipher.RevisionDate;
|
||||
Reprompt = cipher.Reprompt;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
@@ -121,5 +122,6 @@ namespace Bit.Core.Models.Request
|
||||
public Dictionary<string, string> Attachments { get; set; }
|
||||
public Dictionary<string, AttachmentRequest> Attachments2 { get; set; }
|
||||
public DateTime LastKnownRevisionDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Bit.Core.Models.Api;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Api;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -26,5 +27,6 @@ namespace Bit.Core.Models.Response
|
||||
public List<PasswordHistoryResponse> PasswordHistory { get; set; }
|
||||
public List<string> CollectionIds { get; set; }
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace Bit.Core.Models.View
|
||||
public string ExpYear { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string MaskedCode => Code != null ? new string('•', Code.Length) : null;
|
||||
public string MaskedNumber => Number != null ? new string('•', Number.Length) : null;
|
||||
|
||||
public string Brand
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace Bit.Core.Models.View
|
||||
CollectionIds = c.CollectionIds;
|
||||
RevisionDate = c.RevisionDate;
|
||||
DeletedDate = c.DeletedDate;
|
||||
Reprompt = c.Reprompt;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
@@ -47,7 +48,7 @@ namespace Bit.Core.Models.View
|
||||
public HashSet<string> CollectionIds { get; set; }
|
||||
public DateTime RevisionDate { get; set; }
|
||||
public DateTime? DeletedDate { get; set; }
|
||||
|
||||
public CipherRepromptType Reprompt { get; set; }
|
||||
|
||||
public string SubTitle
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user