From 5bea84f4a9977ce70481248926d06905b4c6a8ec Mon Sep 17 00:00:00 2001 From: Zeeshaun Date: Tue, 21 Apr 2026 11:35:51 -0500 Subject: [PATCH] Upating --- .../appsettings.Development.json | 5 ++- .../appsettings.Production.json | 5 ++- .../appsettings.Staging.json | 5 ++- .../LCU.Webapps.Marketing.SPIT/Program.cs | 37 +------------------ .../normal/set_secrets_deployment.yaml | 8 ++-- .../normal/set_secrets_provider.yaml | 4 +- 6 files changed, 20 insertions(+), 44 deletions(-) diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Development.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Development.json index 6fb18cf..51d289c 100644 --- a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Development.json +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Development.json @@ -50,8 +50,11 @@ "http://lcu-internal.com", "https://lcu-internal.com", "https://qa-repomanage.lcu-internal.com", + "https://qa-repo-manager.apps.azure.lcu-internal.com", "https://uat-repomanage.lcu-internal.com", - "https://repomanage.lcu-internal.com" + "https://uat-repo-manager.apps.azure.lcu-internal.com", + "https://repomanage.lcu-internal.com", + "https://prd-repo-manager.apps.azure.lcu-internal.com" ] }, "NadaService": { diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Production.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Production.json index 6c65a08..af6d124 100644 --- a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Production.json +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Production.json @@ -50,8 +50,11 @@ "http://lcu-internal.com", "https://lcu-internal.com", "https://qa-repomanage.lcu-internal.com", + "https://qa-repo-manager.apps.azure.lcu-internal.com", "https://uat-repomanage.lcu-internal.com", - "https://repomanage.lcu-internal.com" + "https://uat-repo-manager.apps.azure.lcu-internal.com", + "https://repomanage.lcu-internal.com", + "https://prd-repo-manager.apps.azure.lcu-internal.com" ] }, "NadaService": { diff --git a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Staging.json b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Staging.json index 91c013d..9598e67 100644 --- a/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Staging.json +++ b/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApi/appsettings.Staging.json @@ -50,8 +50,11 @@ "http://lcu-internal.com", "https://lcu-internal.com", "https://qa-repomanage.lcu-internal.com", + "https://qa-repo-manager.apps.azure.lcu-internal.com", "https://uat-repomanage.lcu-internal.com", - "https://repomanage.lcu-internal.com" + "https://uat-repo-manager.apps.azure.lcu-internal.com", + "https://repomanage.lcu-internal.com", + "https://prd-repo-manager.apps.azure.lcu-internal.com" ] }, "NadaService": { diff --git a/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/Program.cs b/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/Program.cs index 68fea05..d5841ae 100644 --- a/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/Program.cs +++ b/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/LCU.Webapps.Marketing.SPIT/Program.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; @@ -23,9 +21,10 @@ namespace LCU.Webapps.Marketing.SPIT builder.AddJsonFile("/app/config/workload-appsettings/appsettings.json", optional: true, reloadOnChange: true); builder.AddJsonFile("/vault/secrets/spit-seq-api-key.json", optional: true, reloadOnChange: true); builder.AddJsonFile("/vault/secrets/spit-primary-subscription-key.json", optional: true, reloadOnChange: true); + builder.AddJsonFile("/vault/secrets/spit-speech-api-key.json", optional: true, reloadOnChange: true); + builder.AddJsonFile("/vault/secrets/spit-speech-endpoint.json", optional: true, reloadOnChange: true); builder.AddJsonFile("/vault/secrets/spit-azuread-client-id.json", optional: true, reloadOnChange: true); builder.AddJsonFile("/vault/secrets/spit-azuread-client-secret.json", optional: true, reloadOnChange: true); - builder.AddInMemoryCollection(LoadPlainTextSpeechSecrets()); }) .ConfigureWebHostDefaults(webBuilder => { @@ -33,37 +32,5 @@ namespace LCU.Webapps.Marketing.SPIT .UseSetting(WebHostDefaults.DetailedErrorsKey, "true") .UseSerilog(); }); - - private static IDictionary LoadPlainTextSpeechSecrets() - { - var configValues = new Dictionary(); - var secretMappings = new[] - { - (Path: "/vault/secrets/speech-api-key", Key: "Primary:SpeechApiKey"), - (Path: "/vault/secrets/speech-endpoint", Key: "Primary:SpeechEndpoint"), - }; - - foreach (var secretMapping in secretMappings) - { - TryAddSecretValue(configValues, secretMapping.Path, secretMapping.Key); - } - - return configValues; - } - - private static void TryAddSecretValue(IDictionary configValues, string path, string key) - { - if (!File.Exists(path)) - { - return; - } - - var value = File.ReadAllText(path)?.Trim(); - - if (!string.IsNullOrWhiteSpace(value)) - { - configValues[key] = value; - } - } } } diff --git a/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_deployment.yaml b/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_deployment.yaml index ebf158a..2f80f60 100644 --- a/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_deployment.yaml +++ b/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_deployment.yaml @@ -28,17 +28,17 @@ path: /spec/template/spec/containers/0/volumeMounts/- value: name: spit-secrets - mountPath: /vault/secrets/speech-api-key + mountPath: /vault/secrets/spit-speech-api-key.json readOnly: true - subPath: speech-api-key + subPath: spit-speech-api-key - op: add path: /spec/template/spec/containers/0/volumeMounts/- value: name: spit-secrets - mountPath: /vault/secrets/speech-endpoint + mountPath: /vault/secrets/spit-speech-endpoint.json readOnly: true - subPath: speech-endpoint + subPath: spit-speech-endpoint - op: add path: /spec/template/spec/containers/0/volumeMounts/- diff --git a/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_provider.yaml b/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_provider.yaml index 3de0fbc..9b7cac2 100644 --- a/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_provider.yaml +++ b/LCU.Webapps.Marketing.SPIT/kustomize/components/keyvaults/normal/set_secrets_provider.yaml @@ -11,11 +11,11 @@ objectType: secret objectVersion: "" - | - objectName: speech-api-key + objectName: spit-speech-api-key objectType: secret objectVersion: "" - | - objectName: speech-endpoint + objectName: spit-speech-endpoint objectType: secret objectVersion: "" - |