Upating
This commit is contained in:
+4
-1
@@ -50,8 +50,11 @@
|
|||||||
"http://lcu-internal.com",
|
"http://lcu-internal.com",
|
||||||
"https://lcu-internal.com",
|
"https://lcu-internal.com",
|
||||||
"https://qa-repomanage.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://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": {
|
"NadaService": {
|
||||||
|
|||||||
+4
-1
@@ -50,8 +50,11 @@
|
|||||||
"http://lcu-internal.com",
|
"http://lcu-internal.com",
|
||||||
"https://lcu-internal.com",
|
"https://lcu-internal.com",
|
||||||
"https://qa-repomanage.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://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": {
|
"NadaService": {
|
||||||
|
|||||||
+4
-1
@@ -50,8 +50,11 @@
|
|||||||
"http://lcu-internal.com",
|
"http://lcu-internal.com",
|
||||||
"https://lcu-internal.com",
|
"https://lcu-internal.com",
|
||||||
"https://qa-repomanage.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://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": {
|
"NadaService": {
|
||||||
|
|||||||
+2
-35
@@ -1,5 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.Hosting;
|
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("/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-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-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-id.json", optional: true, reloadOnChange: true);
|
||||||
builder.AddJsonFile("/vault/secrets/spit-azuread-client-secret.json", optional: true, reloadOnChange: true);
|
builder.AddJsonFile("/vault/secrets/spit-azuread-client-secret.json", optional: true, reloadOnChange: true);
|
||||||
builder.AddInMemoryCollection(LoadPlainTextSpeechSecrets());
|
|
||||||
})
|
})
|
||||||
.ConfigureWebHostDefaults(webBuilder =>
|
.ConfigureWebHostDefaults(webBuilder =>
|
||||||
{
|
{
|
||||||
@@ -33,37 +32,5 @@ namespace LCU.Webapps.Marketing.SPIT
|
|||||||
.UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
|
.UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
|
||||||
.UseSerilog();
|
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -28,17 +28,17 @@
|
|||||||
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
|
mountPath: /vault/secrets/spit-speech-api-key.json
|
||||||
readOnly: true
|
readOnly: true
|
||||||
subPath: speech-api-key
|
subPath: spit-speech-api-key
|
||||||
|
|
||||||
- op: add
|
- op: add
|
||||||
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
|
mountPath: /vault/secrets/spit-speech-endpoint.json
|
||||||
readOnly: true
|
readOnly: true
|
||||||
subPath: speech-endpoint
|
subPath: spit-speech-endpoint
|
||||||
|
|
||||||
- op: add
|
- op: add
|
||||||
path: /spec/template/spec/containers/0/volumeMounts/-
|
path: /spec/template/spec/containers/0/volumeMounts/-
|
||||||
|
|||||||
+2
-2
@@ -11,11 +11,11 @@
|
|||||||
objectType: secret
|
objectType: secret
|
||||||
objectVersion: ""
|
objectVersion: ""
|
||||||
- |
|
- |
|
||||||
objectName: speech-api-key
|
objectName: spit-speech-api-key
|
||||||
objectType: secret
|
objectType: secret
|
||||||
objectVersion: ""
|
objectVersion: ""
|
||||||
- |
|
- |
|
||||||
objectName: speech-endpoint
|
objectName: spit-speech-endpoint
|
||||||
objectType: secret
|
objectType: secret
|
||||||
objectVersion: ""
|
objectVersion: ""
|
||||||
- |
|
- |
|
||||||
|
|||||||
Reference in New Issue
Block a user