This commit is contained in:
Zeeshaun
2026-04-20 19:27:02 +00:00
parent 8c668fa319
commit 89057eceea
2 changed files with 12 additions and 5 deletions
@@ -37,14 +37,21 @@ namespace LCU.Webapps.Marketing.SPIT
private static IDictionary<string, string> LoadPlainTextSpeechSecrets() private static IDictionary<string, string> LoadPlainTextSpeechSecrets()
{ {
var configValues = new Dictionary<string, string>(); 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"),
};
AddSecretValue(configValues, "/vault/secrets/speech-api-key.json", "Primary:SpeechApiKey"); foreach (var secretMapping in secretMappings)
AddSecretValue(configValues, "/vault/secrets/speech-endpoint.json", "Primary:SpeechEndpoint"); {
TryAddSecretValue(configValues, secretMapping.Path, secretMapping.Key);
}
return configValues; return configValues;
} }
private static void AddSecretValue(IDictionary<string, string> configValues, string path, string key) private static void TryAddSecretValue(IDictionary<string, string> configValues, string path, string key)
{ {
if (!File.Exists(path)) if (!File.Exists(path))
{ {
@@ -28,7 +28,7 @@
path: /spec/template/spec/containers/0/volumeMounts/- path: /spec/template/spec/containers/0/volumeMounts/-
value: value:
name: spit-secrets name: spit-secrets
mountPath: /vault/secrets/speech-api-key.json mountPath: /vault/secrets/speech-api-key
readOnly: true readOnly: true
subPath: speech-api-key subPath: speech-api-key
@@ -36,7 +36,7 @@
path: /spec/template/spec/containers/0/volumeMounts/- path: /spec/template/spec/containers/0/volumeMounts/-
value: value:
name: spit-secrets name: spit-secrets
mountPath: /vault/secrets/speech-endpoint.json mountPath: /vault/secrets/speech-endpoint
readOnly: true readOnly: true
subPath: speech-endpoint subPath: speech-endpoint