From 98c167b1c1c3f0e7455d80e418bbcaf0564e7e5b Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Wed, 3 Nov 2021 07:12:43 +1000 Subject: [PATCH] Improve local dev setup for SSO project (#1664) * Add default SSO appsettings for development * Add Sso project to setup_secrets.ps1 script * Use hashmap instead of array --- .../src/Sso/appsettings.Development.json | 9 ++++++ dev/setup_secrets.ps1 | 29 ++++++++++++++----- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/bitwarden_license/src/Sso/appsettings.Development.json b/bitwarden_license/src/Sso/appsettings.Development.json index 4a8fc1ea5..efe36471f 100644 --- a/bitwarden_license/src/Sso/appsettings.Development.json +++ b/bitwarden_license/src/Sso/appsettings.Development.json @@ -13,6 +13,15 @@ "internalApi": "http://localhost:4000", "internalVault": "http://localhost:4001", "internalSso": "http://localhost:51822" + }, + "events": { + "connectionString": "UseDevelopmentStorage=true" + }, + "notifications": { + "connectionString": "UseDevelopmentStorage=true" + }, + "storage": { + "connectionString": "UseDevelopmentStorage=true" } } } diff --git a/dev/setup_secrets.ps1 b/dev/setup_secrets.ps1 index 4a5cf4738..c3c717a92 100644 --- a/dev/setup_secrets.ps1 +++ b/dev/setup_secrets.ps1 @@ -11,11 +11,26 @@ if (!(Test-Path "secrets.json")) { exit; } -$projects = "Admin", "Api", "Billing", "Events", "EventsProcessor", "Icons", "Identity", "Notifications"; - -foreach ($projects in $projects) { - if ($clear -eq $true) { - dotnet user-secrets clear -p "../src/$projects" - } - Get-Content secrets.json | & dotnet user-secrets set -p "../src/$projects" +if ($clear -eq $true) { + Write-Output "Deleting all existing user secrets" +} + +$projects = @{ + Admin = "../src/Admin" + Api = "../src/Api" + Billing = "../src/Billing" + Events = "../src/Events" + EventsProcessor = "../src/EventsProcessor" + Icons = "../src/Icons" + Identity = "../src/Identity" + Notifications = "../src/Notifications" + Sso = "../bitwarden_license/src/Sso" +} + +foreach ($key in $projects.keys) { + if ($clear -eq $true) { + dotnet user-secrets clear -p $projects[$key] + } + $output = Get-Content secrets.json | & dotnet user-secrets set -p $projects[$key] + Write-Output "$output - $key" }