1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-28 23:04:50 -05:00

do things when not dev

This commit is contained in:
Kyle Spearrin 2017-07-14 13:29:52 -04:00
parent 25fccfc3fd
commit 64212a1874
3 changed files with 7 additions and 7 deletions

View File

@ -180,7 +180,7 @@ namespace Bit.Api
{ {
Authority = authority, Authority = authority,
AllowedScopes = new string[] { "api" }, AllowedScopes = new string[] { "api" },
RequireHttpsMetadata = env.IsProduction(), RequireHttpsMetadata = !env.IsDevelopment(),
ApiName = "api", ApiName = "api",
NameClaimType = ClaimTypes.Email, NameClaimType = ClaimTypes.Email,
// Suffix until we retire the old jwt schemes. // Suffix until we retire the old jwt schemes.

View File

@ -15,7 +15,7 @@ namespace Bit.Core.Utilities
GlobalSettings globalSettings, GlobalSettings globalSettings,
Func<LogEvent, bool> filter = null) Func<LogEvent, bool> filter = null)
{ {
if(env.IsProduction()) if(!env.IsDevelopment())
{ {
if(filter == null) if(filter == null)
{ {

View File

@ -132,14 +132,14 @@ namespace Bit.Core.Utilities
services.AddTransient<ICorsPolicyService, AllowAllCorsPolicyService>(); services.AddTransient<ICorsPolicyService, AllowAllCorsPolicyService>();
if(env.IsProduction()) if(env.IsDevelopment())
{ {
var identityServerCert = CoreHelpers.GetCertificate(globalSettings.IdentityServer.CertificateThumbprint); identityServerBuilder.AddTemporarySigningCredential();
identityServerBuilder.AddSigningCredential(identityServerCert);
} }
else else
{ {
identityServerBuilder.AddTemporarySigningCredential(); var identityServerCert = CoreHelpers.GetCertificate(globalSettings.IdentityServer.CertificateThumbprint);
identityServerBuilder.AddSigningCredential(identityServerCert);
} }
services.AddScoped<IResourceOwnerPasswordValidator, ResourceOwnerPasswordValidator>(); services.AddScoped<IResourceOwnerPasswordValidator, ResourceOwnerPasswordValidator>();
@ -152,7 +152,7 @@ namespace Bit.Core.Utilities
public static void AddCustomDataProtectionServices( public static void AddCustomDataProtectionServices(
this IServiceCollection services, IHostingEnvironment env, GlobalSettings globalSettings) this IServiceCollection services, IHostingEnvironment env, GlobalSettings globalSettings)
{ {
if(env.IsProduction()) if(!env.IsDevelopment())
{ {
var dataProtectionCert = CoreHelpers.GetCertificate(globalSettings.DataProtection.CertificateThumbprint); var dataProtectionCert = CoreHelpers.GetCertificate(globalSettings.DataProtection.CertificateThumbprint);
var storageAccount = CloudStorageAccount.Parse(globalSettings.Storage.ConnectionString); var storageAccount = CloudStorageAccount.Parse(globalSettings.Storage.ConnectionString);