1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-20 20:45:10 -05:00
bitwarden/src/Api/Models/CipherPasswordHistoryModel.cs
2022-08-29 16:06:55 -04:00

29 lines
739 B
C#

using System.ComponentModel.DataAnnotations;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
namespace Bit.Api.Models;
public class CipherPasswordHistoryModel
{
public CipherPasswordHistoryModel() { }
public CipherPasswordHistoryModel(CipherPasswordHistoryData data)
{
Password = data.Password;
LastUsedDate = data.LastUsedDate;
}
[EncryptedString]
[EncryptedStringLength(5000)]
[Required]
public string Password { get; set; }
[Required]
public DateTime? LastUsedDate { get; set; }
public CipherPasswordHistoryData ToCipherPasswordHistoryData()
{
return new CipherPasswordHistoryData { Password = Password, LastUsedDate = LastUsedDate.Value, };
}
}