fix: Aktualisiert, um die Konfiguration über consumers-api.json zu ermöglichen.
This commit is contained in:
parent
d6315ce8a5
commit
a73885286f
@ -14,7 +14,7 @@ using System.Security.Claims;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Configuration.AddJsonFile("consumer-api.json", true, true);
|
||||
builder.Configuration.AddJsonFile("consumers-api.json", true, true);
|
||||
|
||||
var config = builder.Configuration;
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ namespace DigitalData.Auth.API.Services
|
||||
{
|
||||
public static IServiceCollection AddConsumerApiServiceFromConfiguration(this IServiceCollection services, IConfiguration configuration, string key = "ConsumerAPIs")
|
||||
{
|
||||
var consumerApis = configuration.GetSection("ConsumerAPIs").Get<IEnumerable<ConsumerApi>>() ?? throw new InvalidOperationException($"No Consumer list found in {key} in configuration.");
|
||||
var consumerApis = configuration.GetSection(key).Get<IEnumerable<ConsumerApi>>() ?? throw new InvalidOperationException($"No Consumer list found in {key} in configuration.");
|
||||
services.AddSingleton(Options.Create(consumerApis));
|
||||
services.AddSingleton<IConsumerApiService, ConfiguredConsumerApiService>();
|
||||
return services;
|
||||
|
||||
@ -50,15 +50,5 @@
|
||||
"Lifetime": "02:00:00"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ConsumerAPIs": [
|
||||
{
|
||||
"Name": "WorkFlow.API",
|
||||
"Password": "t3B|aiJ'i-snLzNRj3B{9=&:lM5P@'iL"
|
||||
},
|
||||
{
|
||||
"Name": "DigitalData.UserManager.API",
|
||||
"Password": "a098Hvu1-y29ep{KPQO]#>8TK+fk{O`_d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
"ConsumerAPIs": [
|
||||
{
|
||||
"Name": "WorkFlow.API",
|
||||
"Password": "t3B|aiJ'i-snLzNRj3B{9=&:lM5P@'i<EFBFBD>L"
|
||||
"Password": "t3B|aiJ'i-snLzNRj3B{9=&:lM5P@'iL"
|
||||
},
|
||||
{
|
||||
"Name": "DigitalData.UserManager.API",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user