1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -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:
Kyle Spearrin
2017-02-11 23:00:55 -05:00
parent 7589f9c933
commit 024ee08907
6 changed files with 75 additions and 4 deletions

View File

@ -263,6 +263,22 @@ namespace Bit.Api.Controllers
return response;
}
[HttpPut("keys")]
[HttpPost("keys")]
public async Task<KeysResponseModel> PutKeys([FromBody]KeysRequestModel model)
{
var user = await _userService.GetUserByPrincipalAsync(User);
await _userService.SaveUserAsync(model.ToUser(user));
return new KeysResponseModel(user);
}
[HttpGet("keys")]
public async Task<KeysResponseModel> GetKeys()
{
var user = await _userService.GetUserByPrincipalAsync(User);
return new KeysResponseModel(user);
}
[HttpPost("delete")]
public async Task PostDelete([FromBody]DeleteAccountRequestModel model)
{