reparieren: App-Einstellungen so angeordnet, dass sie Consuemr-Apis erreichen können
This commit is contained in:
parent
a66570bebb
commit
cd4428b8f0
@ -13,10 +13,10 @@ using System.Security.Claims;
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
var config = builder.Configuration;
|
|
||||||
|
|
||||||
builder.Configuration.AddJsonFile("consumer-api.json", true, true);
|
builder.Configuration.AddJsonFile("consumer-api.json", true, true);
|
||||||
|
|
||||||
|
var config = builder.Configuration;
|
||||||
|
|
||||||
var apiParams = config.Get<AuthApiParams>() ?? throw new InvalidOperationException("AuthApiOptions is missing or invalid in appsettings.");
|
var apiParams = config.Get<AuthApiParams>() ?? throw new InvalidOperationException("AuthApiOptions is missing or invalid in appsettings.");
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
|
|||||||
@ -8,7 +8,7 @@ namespace DigitalData.Auth.API.Services
|
|||||||
{
|
{
|
||||||
public static IServiceCollection AddConsumerApiServiceFromConfiguration(this IServiceCollection services, IConfiguration configuration, string key = "ConsumerAPIs")
|
public static IServiceCollection AddConsumerApiServiceFromConfiguration(this IServiceCollection services, IConfiguration configuration, string key = "ConsumerAPIs")
|
||||||
{
|
{
|
||||||
var consumerApis = configuration.GetValue<IEnumerable<ConsumerApi>>("ConsumerAPIs") ?? throw new InvalidOperationException($"No Consumer list found in {key} in configuration.");
|
var consumerApis = configuration.GetSection("ConsumerAPIs").Get<List<ConsumerApi>>() ?? throw new InvalidOperationException($"No Consumer list found in {key} in configuration.");
|
||||||
services.AddSingleton(Options.Create(consumerApis));
|
services.AddSingleton(Options.Create(consumerApis));
|
||||||
services.AddSingleton<IConsumerApiService, ConfiguredConsumerApiService>();
|
services.AddSingleton<IConsumerApiService, ConfiguredConsumerApiService>();
|
||||||
return services;
|
return services;
|
||||||
|
|||||||
@ -35,5 +35,15 @@
|
|||||||
"ApiRoute": "client"
|
"ApiRoute": "client"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"ConsumerAPIs": [
|
||||||
|
{
|
||||||
|
"Name": "WorkFlow.API",
|
||||||
|
"Password": "t3B|aiJ'i-snLzNRj3B{9=&:lM5P@'i<>L"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "DigitalData.UserManager.API",
|
||||||
|
"Password": "a098Hvu1-y29ep{KPQO]#>8TK+fk{O`_d"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user