1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

Update APIs to collect other set password info (#870)

This commit is contained in:
Kyle Spearrin
2020-08-17 10:40:35 -04:00
committed by GitHub
parent af85e17486
commit d190c4bd0f
3 changed files with 26 additions and 6 deletions

View File

@ -1,4 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
namespace Bit.Core.Models.Api.Request.Accounts
{
@ -6,8 +8,26 @@ namespace Bit.Core.Models.Api.Request.Accounts
{
[Required]
[StringLength(300)]
public string NewMasterPasswordHash { get; set; }
public string MasterPasswordHash { get; set; }
[Required]
public string Key { get; set; }
[StringLength(50)]
public string MasterPasswordHint { get; set; }
[Required]
public KeysRequestModel Keys { get; set; }
[Required]
public KdfType Kdf { get; set; }
[Required]
public int KdfIterations { get; set; }
public User ToUser(User existingUser)
{
existingUser.MasterPasswordHint = MasterPasswordHint;
existingUser.Kdf = Kdf;
existingUser.KdfIterations = KdfIterations;
existingUser.Key = Key;
Keys.ToUser(existingUser);
return existingUser;
}
}
}