2021-10-25 15:09:14 +02:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2022-01-11 10:40:51 +01:00
|
|
|
|
using Bit.Core.Entities;
|
2021-10-25 15:09:14 +02:00
|
|
|
|
using Bit.Core.Enums;
|
2022-01-17 13:21:51 +01:00
|
|
|
|
using Bit.Core.Models.Api.Request.Accounts;
|
2021-10-25 15:09:14 +02:00
|
|
|
|
|
2021-12-14 15:05:07 +00:00
|
|
|
|
namespace Bit.Api.Models.Request.Accounts;
|
2022-08-29 14:53:16 -04:00
|
|
|
|
|
2021-12-14 15:05:07 +00:00
|
|
|
|
public class SetKeyConnectorKeyRequestModel
|
2021-10-25 15:09:14 +02:00
|
|
|
|
{
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public string Key { get; set; }
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public KeysRequestModel Keys { get; set; }
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public KdfType Kdf { get; set; }
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public int KdfIterations { get; set; }
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public string OrgIdentifier { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public User ToUser(User existingUser)
|
|
|
|
|
|
{
|
|
|
|
|
|
existingUser.Kdf = Kdf;
|
|
|
|
|
|
existingUser.KdfIterations = KdfIterations;
|
|
|
|
|
|
existingUser.Key = Key;
|
|
|
|
|
|
Keys.ToUser(existingUser);
|
|
|
|
|
|
return existingUser;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|