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

Transition reference id to data (#828)

* Transition reference id to data

* field length and request model updates
This commit is contained in:
Chad Scharf
2020-07-20 15:19:46 -04:00
committed by GitHub
parent 036b402e9f
commit 83e9468502
15 changed files with 510 additions and 23 deletions

View File

@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Models.Business;
using Bit.Core.Models.Table;
using Newtonsoft.Json;
namespace Bit.Core.Models.Api
{
@ -25,7 +27,7 @@ namespace Bit.Core.Models.Api
public Guid? OrganizationUserId { get; set; }
public KdfType? Kdf { get; set; }
public int? KdfIterations { get; set; }
public string ReferenceId { get; set; }
public Dictionary<string, object> ReferenceData { get; set; }
public User ToUser()
{
@ -36,9 +38,13 @@ namespace Bit.Core.Models.Api
MasterPasswordHint = MasterPasswordHint,
Kdf = Kdf.GetValueOrDefault(KdfType.PBKDF2_SHA256),
KdfIterations = KdfIterations.GetValueOrDefault(5000),
ReferenceId = ReferenceId,
};
if (ReferenceData != null)
{
user.ReferenceData = JsonConvert.SerializeObject(ReferenceData);
}
if (Key != null)
{
user.Key = Key;