From cdfa936f6beeede4a1d970ab27d70888ee699b3d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 18 Apr 2017 14:08:58 -0400 Subject: [PATCH] fixes for preview deployment --- src/Api/Startup.cs | 5 +++-- src/Api/settings.Preview.json | 5 +++++ .../SubvaultCipher_UpdateSubvaultsAdmin.sql | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 src/Api/settings.Preview.json diff --git a/src/Api/Startup.cs b/src/Api/Startup.cs index 7e022b2014..c638bad0a0 100644 --- a/src/Api/Startup.cs +++ b/src/Api/Startup.cs @@ -278,8 +278,9 @@ namespace Bit.Api app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions { AllowedScopes = new string[] { "api" }, - Authority = env.IsProduction() ? "https://api.bitwarden.com" : "http://localhost:4000", - RequireHttpsMetadata = env.IsProduction(), + Authority = env.IsProduction() ? "https://api.bitwarden.com" : env.IsEnvironment("Preview") ? + "https://bitwardenpreviewapi-j9dv6m.azurewebsites.net" : "http://localhost:4000", + RequireHttpsMetadata = !env.IsDevelopment(), ApiName = "api", NameClaimType = ClaimTypes.Email, // Version "2" until we retire the old jwt scheme and replace it with this one. diff --git a/src/Api/settings.Preview.json b/src/Api/settings.Preview.json new file mode 100644 index 0000000000..af3e0db560 --- /dev/null +++ b/src/Api/settings.Preview.json @@ -0,0 +1,5 @@ +{ + "globalSettings": { + "baseVaultUri": "https://previewvault.bitwarden.com/#" + } +} diff --git a/src/Sql/dbo/Stored Procedures/SubvaultCipher_UpdateSubvaultsAdmin.sql b/src/Sql/dbo/Stored Procedures/SubvaultCipher_UpdateSubvaultsAdmin.sql index 945a6119e4..57454fc35e 100644 --- a/src/Sql/dbo/Stored Procedures/SubvaultCipher_UpdateSubvaultsAdmin.sql +++ b/src/Sql/dbo/Stored Procedures/SubvaultCipher_UpdateSubvaultsAdmin.sql @@ -22,7 +22,7 @@ BEGIN [Target].[SubvaultId] = [Source].[Id] AND [Target].[CipherId] = @CipherId WHEN NOT MATCHED BY TARGET - AND [Source].[Id] IN (SELECT [SubvaultId] FROM [AvailableSubvaultsCTE]) THEN + AND [Source].[Id] IN (SELECT [Id] FROM [AvailableSubvaultsCTE]) THEN INSERT VALUES ( [Source].[Id],