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

"user key" schema and api changes

This commit is contained in:
Kyle Spearrin
2017-05-31 09:54:32 -04:00
parent bdce4064b2
commit a01d5d9a51
16 changed files with 97 additions and 59 deletions

View File

@ -18,6 +18,6 @@ namespace Bit.Core.Models.Api
[Required]
public string Token { get; set; }
[Required]
public DataReloadRequestModel Data { get; set; }
public string Key { get; set; }
}
}

View File

@ -12,6 +12,6 @@ namespace Bit.Core.Models.Api
[StringLength(300)]
public string NewMasterPasswordHash { get; set; }
[Required]
public DataReloadRequestModel Data { get; set; }
public string Key { get; set; }
}
}

View File

@ -16,6 +16,7 @@ namespace Bit.Core.Models.Api
public string MasterPasswordHash { get; set; }
[StringLength(50)]
public string MasterPasswordHint { get; set; }
public string Key { get; set; }
public KeysRequestModel Keys { get; set; }
public User ToUser()
@ -27,6 +28,11 @@ namespace Bit.Core.Models.Api
MasterPasswordHint = MasterPasswordHint
};
if(Key != null)
{
user.Key = Key;
}
if(Keys != null)
{
Keys.ToUser(user);

View File

@ -3,13 +3,18 @@ using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Models.Api
{
public class DataReloadRequestModel
public class UpdateKeyRequestModel
{
[Required]
[StringLength(300)]
public string MasterPasswordHash { get; set; }
[Required]
public IEnumerable<LoginWithIdRequestModel> Ciphers { get; set; }
[Required]
public IEnumerable<FolderWithIdRequestModel> Folders { get; set; }
[Required]
public string PrivateKey { get; set; }
[Required]
public string Key { get; set; }
}
}

View File

@ -13,10 +13,12 @@ namespace Bit.Core.Models.Api
throw new ArgumentNullException(nameof(user));
}
Key = user.Key;
PublicKey = user.PublicKey;
PrivateKey = user.PrivateKey;
}
public string Key { get; set; }
public string PublicKey { get; set; }
public string PrivateKey { get; set; }
}

View File

@ -21,6 +21,7 @@ namespace Bit.Core.Models.Table
public string EquivalentDomains { get; set; }
public string ExcludedGlobalEquivalentDomains { get; set; }
public DateTime AccountRevisionDate { get; internal set; } = DateTime.UtcNow;
public string Key { get; set; }
public string PublicKey { get; set; }
public string PrivateKey { get; set; }
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;