mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Reference id storage and signup
This commit is contained in:
@ -25,6 +25,7 @@ namespace Bit.Core.Models.Api
|
||||
public Guid? OrganizationUserId { get; set; }
|
||||
public KdfType? Kdf { get; set; }
|
||||
public int? KdfIterations { get; set; }
|
||||
public string ReferenceId { get; set; }
|
||||
|
||||
public User ToUser()
|
||||
{
|
||||
@ -34,7 +35,8 @@ namespace Bit.Core.Models.Api
|
||||
Email = Email,
|
||||
MasterPasswordHint = MasterPasswordHint,
|
||||
Kdf = Kdf.GetValueOrDefault(KdfType.PBKDF2_SHA256),
|
||||
KdfIterations = KdfIterations.GetValueOrDefault(5000)
|
||||
KdfIterations = KdfIterations.GetValueOrDefault(5000),
|
||||
ReferenceId = ReferenceId,
|
||||
};
|
||||
|
||||
if (Key != null)
|
||||
|
@ -38,6 +38,7 @@ namespace Bit.Core.Models.Table
|
||||
public GatewayType? Gateway { get; set; }
|
||||
public string GatewayCustomerId { get; set; }
|
||||
public string GatewaySubscriptionId { get; set; }
|
||||
public string ReferenceId { get; set; }
|
||||
public bool Enabled { get; set; } = true;
|
||||
public string LicenseKey { get; set; }
|
||||
public string ApiKey { get; set; }
|
||||
|
@ -37,6 +37,7 @@ namespace Bit.Core.Models.Table
|
||||
public GatewayType? Gateway { get; set; }
|
||||
public string GatewayCustomerId { get; set; }
|
||||
public string GatewaySubscriptionId { get; set; }
|
||||
public string ReferenceId { get; set; }
|
||||
public string LicenseKey { get; set; }
|
||||
public KdfType Kdf { get; set; } = KdfType.PBKDF2_SHA256;
|
||||
public int KdfIterations { get; set; } = 5000;
|
||||
|
@ -467,11 +467,12 @@ namespace Bit.Core.Services
|
||||
UsersGetPremium = plan.UsersGetPremium || signup.PremiumAccessAddon,
|
||||
Plan = plan.Name,
|
||||
Gateway = null,
|
||||
ReferenceId = signup.Owner.ReferenceId,
|
||||
Enabled = true,
|
||||
LicenseKey = CoreHelpers.SecureRandomString(20),
|
||||
ApiKey = CoreHelpers.SecureRandomString(30),
|
||||
CreationDate = DateTime.UtcNow,
|
||||
RevisionDate = DateTime.UtcNow
|
||||
RevisionDate = DateTime.UtcNow,
|
||||
};
|
||||
|
||||
if (plan.Type == PlanType.Free)
|
||||
@ -541,6 +542,7 @@ namespace Bit.Core.Services
|
||||
Gateway = null,
|
||||
GatewayCustomerId = null,
|
||||
GatewaySubscriptionId = null,
|
||||
ReferenceId = owner.ReferenceId,
|
||||
Enabled = license.Enabled,
|
||||
ExpirationDate = license.Expires,
|
||||
LicenseKey = license.LicenseKey,
|
||||
|
Reference in New Issue
Block a user