mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 17:12:49 -05:00
public and private keys added to db and user domain. added account APIs got getting and putting keys.
This commit is contained in:
23
src/Api/Models/Request/Accounts/KeysRequestModel.cs
Normal file
23
src/Api/Models/Request/Accounts/KeysRequestModel.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Bit.Core.Domains;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Api.Models
|
||||
{
|
||||
public class KeysRequestModel
|
||||
{
|
||||
public string PublicKey { get; set; }
|
||||
[Required]
|
||||
public string PrivateKey { get; set; }
|
||||
|
||||
public User ToUser(User existingUser)
|
||||
{
|
||||
if(!string.IsNullOrWhiteSpace(PublicKey))
|
||||
{
|
||||
existingUser.PublicKey = PublicKey;
|
||||
}
|
||||
|
||||
existingUser.PrivateKey = PrivateKey;
|
||||
return existingUser;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user