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

change email/password adjustments

This commit is contained in:
Kyle Spearrin
2017-04-17 14:53:07 -04:00
parent 184cf0c0df
commit e732996cd9
12 changed files with 98 additions and 19 deletions

View File

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

View File

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

View File

@ -18,8 +18,6 @@ namespace Bit.Core.Models.Api
public string Id { get; set; }
[StringLength(36)]
public string OrganizationId { get; set; }
[StringLength(36)]
public string FolderId { get; set; }
[Required]
[EncryptedString]
[StringLength(300)]

View File

@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Models.Api
{
public class DataReloadRequestModel
{
[Required]
public IEnumerable<LoginWithIdRequestModel> Ciphers { get; set; }
[Required]
public IEnumerable<FolderWithIdRequestModel> Folders { get; set; }
[Required]
public string PrivateKey { get; set; }
}
}

View File

@ -27,4 +27,18 @@ namespace Bit.Core.Models.Api
return existingFolder;
}
}
public class FolderWithIdRequestModel : FolderRequestModel
{
public Guid Id { get; set; }
public new Folder ToFolder(Guid userId)
{
return ToFolder(new Folder
{
UserId = userId,
Id = Id
});
}
}
}

View File

@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
using Newtonsoft.Json;
using Core.Models.Data;
using Bit.Core.Models.Table;
namespace Bit.Core.Models.Api
{
@ -48,4 +49,18 @@ namespace Bit.Core.Models.Api
return existingLogin;
}
}
public class LoginWithIdRequestModel : LoginRequestModel
{
public Guid Id { get; set; }
public Cipher ToCipher(Guid userId)
{
return ToCipherDetails(new CipherDetails
{
UserId = userId,
Id = Id
});
}
}
}