1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

Fix Stripe object lock timeouts (#1735)

* Fix Stripe object lock timeouts

* Move stripe config into globalSetting.stripe
* add MaxNetworkRetries config option with smart defaults

* Rename stripeApiKey to apiKey
This commit is contained in:
Thomas Rittson 2021-11-29 10:01:51 +10:00 committed by GitHub
parent 8dffb27667
commit 90a2a55438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 30 additions and 10 deletions

View File

@ -36,7 +36,8 @@ namespace Bit.Sso
var globalSettings = services.AddGlobalSettingsServices(Configuration);
// Stripe Billing
StripeConfiguration.ApiKey = globalSettings.StripeApiKey;
StripeConfiguration.ApiKey = globalSettings.Stripe.ApiKey;
StripeConfiguration.MaxNetworkRetries = globalSettings.Stripe.MaxNetworkRetries;
// Data Protection
services.AddCustomDataProtectionServices(Environment, globalSettings);

View File

@ -3,7 +3,9 @@
"selfHosted": false,
"siteName": "Bitwarden",
"projectName": "SSO",
"stripeApiKey": "SECRET",
"stripe": {
"apiKey": "SECRET"
},
"oidcIdentityClientKey": "SECRET",
"sqlServer": {
"connectionString": "SECRET"

View File

@ -44,7 +44,8 @@ namespace Bit.Admin
services.AddCustomDataProtectionServices(Environment, globalSettings);
// Stripe Billing
StripeConfiguration.ApiKey = globalSettings.StripeApiKey;
StripeConfiguration.ApiKey = globalSettings.Stripe.ApiKey;
StripeConfiguration.MaxNetworkRetries = globalSettings.Stripe.MaxNetworkRetries;
// Repositories
services.AddSqlServerRepositories(globalSettings);

View File

@ -3,7 +3,9 @@
"selfHosted": false,
"siteName": "Bitwarden",
"projectName": "Admin",
"stripeApiKey": "SECRET",
"stripe": {
"apiKey": "SECRET"
},
"sqlServer": {
"connectionString": "SECRET"
},

View File

@ -61,7 +61,8 @@ namespace Bit.Api
}
// Stripe Billing
StripeConfiguration.ApiKey = globalSettings.StripeApiKey;
StripeConfiguration.ApiKey = globalSettings.Stripe.ApiKey;
StripeConfiguration.MaxNetworkRetries = globalSettings.Stripe.MaxNetworkRetries;
// Repositories
services.AddSqlServerRepositories(globalSettings);

View File

@ -3,7 +3,9 @@
"selfHosted": false,
"siteName": "Bitwarden",
"projectName": "Api",
"stripeApiKey": "SECRET",
"stripe": {
"apiKey": "SECRET"
},
"sqlServer": {
"connectionString": "SECRET"
},

View File

@ -35,7 +35,8 @@ namespace Bit.Billing
services.Configure<BillingSettings>(Configuration.GetSection("BillingSettings"));
// Stripe Billing
StripeConfiguration.ApiKey = globalSettings.StripeApiKey;
StripeConfiguration.ApiKey = globalSettings.Stripe.ApiKey;
StripeConfiguration.MaxNetworkRetries = globalSettings.Stripe.MaxNetworkRetries;
// Repositories
services.AddSqlServerRepositories(globalSettings);

View File

@ -3,7 +3,9 @@
"selfHosted": false,
"siteName": "Bitwarden",
"projectName": "Billing",
"stripeApiKey": "SECRET",
"stripe": {
"apiKey": "SECRET"
},
"sqlServer": {
"connectionString": "SECRET"
},

View File

@ -18,7 +18,6 @@ namespace Bit.Core.Settings
public bool SelfHosted { get; set; }
public virtual string KnownProxies { get; set; }
public virtual string SiteName { get; set; }
public virtual string StripeApiKey { get; set; }
public virtual string ProjectName { get; set; }
public virtual string LogDirectory
{
@ -68,6 +67,7 @@ namespace Bit.Core.Settings
public virtual ServiceBusSettings ServiceBus { get; set; } = new ServiceBusSettings();
public virtual AppleIapSettings AppleIap { get; set; } = new AppleIapSettings();
public virtual SsoSettings Sso { get; set; } = new SsoSettings();
public virtual StripeSettings Stripe { get; set; } = new StripeSettings();
public string BuildExternalUri(string explicitValue, string name)
{
@ -465,5 +465,11 @@ namespace Bit.Core.Settings
public string HCaptchaSecretKey { get; set; }
public string HCaptchaSiteKey { get; set; }
}
public class StripeSettings
{
public string ApiKey { get; set; }
public int MaxNetworkRetries { get; set; } = 2;
}
}
}

View File

@ -3,7 +3,9 @@
"selfHosted": false,
"siteName": "Bitwarden",
"projectName": "Identity",
"stripeApiKey": "SECRET",
"stripe": {
"apiKey": "SECRET"
},
"oidcIdentityClientKey": "SECRET",
"sqlServer": {
"connectionString": "SECRET"