This commit is contained in:
Zeeshaun
2026-04-21 11:35:51 -05:00
parent 8b3ea92501
commit 5bea84f4a9
6 changed files with 20 additions and 44 deletions
@@ -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": {
@@ -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": {
@@ -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": {
@@ -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<string, string> LoadPlainTextSpeechSecrets()
{
var configValues = new Dictionary<string, string>();
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<string, string> configValues, string path, string key)
{
if (!File.Exists(path))
{
return;
}
var value = File.ReadAllText(path)?.Trim();
if (!string.IsNullOrWhiteSpace(value))
{
configValues[key] = value;
}
}
}
}
@@ -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/-
@@ -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: ""
- |