1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 05:00:19 -05: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); var globalSettings = services.AddGlobalSettingsServices(Configuration);
// Stripe Billing // Stripe Billing
StripeConfiguration.ApiKey = globalSettings.StripeApiKey; StripeConfiguration.ApiKey = globalSettings.Stripe.ApiKey;
StripeConfiguration.MaxNetworkRetries = globalSettings.Stripe.MaxNetworkRetries;
// Data Protection // Data Protection
services.AddCustomDataProtectionServices(Environment, globalSettings); services.AddCustomDataProtectionServices(Environment, globalSettings);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,7 +18,6 @@ namespace Bit.Core.Settings
public bool SelfHosted { get; set; } public bool SelfHosted { get; set; }
public virtual string KnownProxies { get; set; } public virtual string KnownProxies { get; set; }
public virtual string SiteName { get; set; } public virtual string SiteName { get; set; }
public virtual string StripeApiKey { get; set; }
public virtual string ProjectName { get; set; } public virtual string ProjectName { get; set; }
public virtual string LogDirectory public virtual string LogDirectory
{ {
@ -68,6 +67,7 @@ namespace Bit.Core.Settings
public virtual ServiceBusSettings ServiceBus { get; set; } = new ServiceBusSettings(); public virtual ServiceBusSettings ServiceBus { get; set; } = new ServiceBusSettings();
public virtual AppleIapSettings AppleIap { get; set; } = new AppleIapSettings(); public virtual AppleIapSettings AppleIap { get; set; } = new AppleIapSettings();
public virtual SsoSettings Sso { get; set; } = new SsoSettings(); public virtual SsoSettings Sso { get; set; } = new SsoSettings();
public virtual StripeSettings Stripe { get; set; } = new StripeSettings();
public string BuildExternalUri(string explicitValue, string name) public string BuildExternalUri(string explicitValue, string name)
{ {
@ -465,5 +465,11 @@ namespace Bit.Core.Settings
public string HCaptchaSecretKey { get; set; } public string HCaptchaSecretKey { get; set; }
public string HCaptchaSiteKey { 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, "selfHosted": false,
"siteName": "Bitwarden", "siteName": "Bitwarden",
"projectName": "Identity", "projectName": "Identity",
"stripeApiKey": "SECRET", "stripe": {
"apiKey": "SECRET"
},
"oidcIdentityClientKey": "SECRET", "oidcIdentityClientKey": "SECRET",
"sqlServer": { "sqlServer": {
"connectionString": "SECRET" "connectionString": "SECRET"