Update License to use Secrets Manager fully (#182)

This commit is contained in:
Rakesh 2024-01-20 02:02:14 +08:00 committed by GitHub
parent e173c06320
commit b93c9487eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -414,8 +414,8 @@ namespace bitwardenSelfLicensor
set("BillingEmail", email);
set("BusinessName", string.IsNullOrWhiteSpace(businessName) ? "BitBetter" : businessName);
set("Enabled", true);
set("Plan", "Custom");
set("PlanType", Enum.Parse(planTypeEnum, "Custom"));
set("Plan", "Enterprise (Annually)");
set("PlanType", Enum.Parse(planTypeEnum, "EnterpriseAnnually"));
set("Seats", int.MaxValue);
set("MaxCollections", short.MaxValue);
set("UsePolicies", true);
@ -437,12 +437,13 @@ namespace bitwardenSelfLicensor
set("UseSecretsManager", true);
set("SmSeats", int.MaxValue);
set("SmServiceAccounts", int.MaxValue);
set("Version", 12);
set("Version", 14); //This is set to 14 to use LimitCollectionCreationDeletion can be changed to 13 to just use Secrets Manager
set("Issued", DateTime.UtcNow);
set("Refresh", DateTime.UtcNow.AddYears(100).AddMonths(-1));
set("Expires", DateTime.UtcNow.AddYears(100));
set("Trial", false);
set("LicenseType", Enum.Parse(licenseTypeEnum, "Organization"));
set("LimitCollectionCreationDeletion", true); //This will be used in the new version of BitWarden but can be applied now
set("Hash", Convert.ToBase64String((byte[])type.GetMethod("ComputeHash").Invoke(license, new object[0])));
set("Signature", Convert.ToBase64String((byte[])type.GetMethod("Sign").Invoke(license, new object[] { cert })));