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

org totp and storage flags

This commit is contained in:
Kyle Spearrin
2017-07-07 14:08:30 -04:00
parent 43262e577c
commit fbc189544b
20 changed files with 97 additions and 17 deletions

View File

@ -48,11 +48,13 @@ namespace Bit.Core.Models.Api
FolderId = cipher.FolderId?.ToString();
Favorite = cipher.Favorite;
Edit = cipher.Edit;
OrganizationUseTotp = cipher.OrganizationUseTotp;
}
public string FolderId { get; set; }
public bool Favorite { get; set; }
public bool Edit { get; set; }
public bool OrganizationUseTotp { get; set; }
}
public class CipherDetailsResponseModel : CipherResponseModel

View File

@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api
{
public class LoginResponseModel : ResponseModel
{
public LoginResponseModel(Cipher cipher, GlobalSettings globalSettings, string obj = "login")
public LoginResponseModel(Cipher cipher, GlobalSettings globalSettings, bool orgUseTotp, string obj = "login")
: base(obj)
{
if(cipher == null)
@ -32,11 +32,12 @@ namespace Bit.Core.Models.Api
Totp = data.Totp;
RevisionDate = cipher.RevisionDate;
Edit = true;
OrganizationUseTotp = orgUseTotp;
Attachments = AttachmentResponseModel.FromCipher(cipher, globalSettings);
}
public LoginResponseModel(CipherDetails cipher, GlobalSettings globalSettings, string obj = "login")
: this(cipher as Cipher, globalSettings, obj)
: this(cipher as Cipher, globalSettings, cipher.OrganizationUseTotp, obj)
{
FolderId = cipher.FolderId?.ToString();
Favorite = cipher.Favorite;
@ -48,6 +49,7 @@ namespace Bit.Core.Models.Api
public string FolderId { get; set; }
public bool Favorite { get; set; }
public bool Edit { get; set; }
public bool OrganizationUseTotp { get; set; }
public string Name { get; set; }
public string Uri { get; set; }
public string Username { get; set; }

View File

@ -12,8 +12,10 @@ namespace Bit.Core.Models.Api
Name = organization.Name;
UseGroups = organization.UseGroups;
UseDirectory = organization.UseDirectory;
UseTotp = organization.UseTotp;
Seats = organization.Seats;
MaxCollections = organization.MaxCollections;
MaxStorageGb = organization.MaxStorageGb;
Key = organization.Key;
Status = organization.Status;
Type = organization.Type;
@ -24,8 +26,10 @@ namespace Bit.Core.Models.Api
public string Name { get; set; }
public bool UseGroups { get; set; }
public bool UseDirectory { get; set; }
public bool UseTotp { get; set; }
public int Seats { get; set; }
public int MaxCollections { get; set; }
public short? MaxStorageGb { get; set; }
public string Key { get; set; }
public OrganizationUserStatusType Status { get; set; }
public OrganizationUserType Type { get; set; }

View File

@ -8,5 +8,6 @@ namespace Core.Models.Data
public Guid? FolderId { get; set; }
public bool Favorite { get; set; }
public bool Edit { get; set; }
public bool OrganizationUseTotp { get; set; }
}
}

View File

@ -9,8 +9,10 @@ namespace Bit.Core.Models.Data
public string Name { get; set; }
public bool UseGroups { get; set; }
public bool UseDirectory { get; set; }
public bool UseTotp { get; set; }
public int Seats { get; set; }
public int MaxCollections { get; set; }
public short? MaxStorageGb { get; set; }
public string Key { get; set; }
public Enums.OrganizationUserStatusType Status { get; set; }
public Enums.OrganizationUserType Type { get; set; }

View File

@ -13,6 +13,8 @@ namespace Bit.Core.Models.StaticStore
public short? MaxAdditionalSeats { get; set; }
public bool UseGroups { get; set; }
public bool UseDirectory { get; set; }
public bool UseTotp { get; set; }
public short? MaxStorageGb { get; set; }
public decimal BasePrice { get; set; }
public decimal SeatPrice { get; set; }
public short? MaxCollections { get; set; }

View File

@ -16,6 +16,7 @@ namespace Bit.Core.Models.Table
public short? MaxCollections { get; set; }
public bool UseGroups { get; set; }
public bool UseDirectory { get; set; }
public bool UseTotp { get; set; }
public long? Storage { get; set; }
public short? MaxStorageGb { get; set; }
public string StripeCustomerId { get; set; }