mirror of
https://github.com/bitwarden/server.git
synced 2025-07-06 10:32:49 -05:00
store password history and revision dates
This commit is contained in:
@ -13,10 +13,12 @@ namespace Bit.Core.Models.Data
|
||||
Name = cipher.Name;
|
||||
Notes = cipher.Notes;
|
||||
Fields = cipher.Fields?.Select(f => new CipherFieldData(f));
|
||||
PasswordHistory = cipher.PasswordHistory?.Select(ph => new CipherPasswordHistoryData(ph));
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public IEnumerable<CipherFieldData> Fields { get; set; }
|
||||
public IEnumerable<CipherPasswordHistoryData> PasswordHistory { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Api;
|
||||
@ -17,6 +18,7 @@ namespace Bit.Core.Models.Data
|
||||
Uris = cipher.Login.Uris?.Where(u => u != null).Select(u => new CipherLoginUriData(u));
|
||||
Username = cipher.Login.Username;
|
||||
Password = cipher.Login.Password;
|
||||
PasswordRevisionDate = cipher.Login.PasswordRevisionDate;
|
||||
Totp = cipher.Login.Totp;
|
||||
}
|
||||
|
||||
@ -28,6 +30,7 @@ namespace Bit.Core.Models.Data
|
||||
public IEnumerable<CipherLoginUriData> Uris { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public DateTime? PasswordRevisionDate { get; set; }
|
||||
public string Totp { get; set; }
|
||||
|
||||
public class CipherLoginUriData
|
||||
|
19
src/Core/Models/Data/CipherPasswordHistoryData.cs
Normal file
19
src/Core/Models/Data/CipherPasswordHistoryData.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Bit.Core.Models.Api;
|
||||
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public class CipherPasswordHistoryData
|
||||
{
|
||||
public CipherPasswordHistoryData() { }
|
||||
|
||||
public CipherPasswordHistoryData(CipherPasswordHistoryModel phModel)
|
||||
{
|
||||
Password = phModel.Password;
|
||||
LastUsedDate = phModel.LastUsedDate.Value;
|
||||
}
|
||||
|
||||
public string Password { get; set; }
|
||||
public DateTime LastUsedDate { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user