1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Password re-prompt (#1269)

* Add support for password re-prompt
This commit is contained in:
Oscar Hinton
2021-04-29 15:43:44 +02:00
committed by GitHub
parent 17db94190e
commit 2054e5a926
11 changed files with 229 additions and 6 deletions

View File

@ -20,6 +20,7 @@ namespace Bit.Core.Models.Api
public string OrganizationId { get; set; }
public string FolderId { get; set; }
public bool Favorite { get; set; }
public CipherRepromptType Reprompt { get; set; }
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
@ -59,6 +60,7 @@ namespace Bit.Core.Models.Api
{
existingCipher.FolderId = string.IsNullOrWhiteSpace(FolderId) ? null : (Guid?)new Guid(FolderId);
existingCipher.Favorite = Favorite;
existingCipher.Reprompt = Reprompt;
ToCipher(existingCipher);
return existingCipher;
}

View File

@ -6,6 +6,7 @@ using System.Linq;
using Newtonsoft.Json;
using Bit.Core.Models.Data;
using Bit.Core.Settings;
using Bit.Core.Enums;
namespace Bit.Core.Models.Api
{
@ -91,12 +92,14 @@ namespace Bit.Core.Models.Api
Favorite = cipher.Favorite;
Edit = cipher.Edit;
ViewPassword = cipher.ViewPassword;
Reprompt = cipher.Reprompt.GetValueOrDefault(CipherRepromptType.None);
}
public string FolderId { get; set; }
public bool Favorite { get; set; }
public bool Edit { get; set; }
public bool ViewPassword { get; set; }
public CipherRepromptType Reprompt { get; set; }
}
public class CipherDetailsResponseModel : CipherResponseModel

View File

@ -21,6 +21,7 @@ namespace Bit.Core.Models.Table
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
public DateTime? DeletedDate { get; internal set; }
public Enums.CipherRepromptType? Reprompt { get; set; }
public void SetNewId()
{