compose and authority fixes. finish sprints.
This commit is contained in:
@@ -175,22 +175,30 @@ if (authorityOptions.Enabled)
|
||||
resourceOptions.BackchannelTimeout = TimeSpan.FromSeconds(authorityOptions.BackchannelTimeoutSeconds);
|
||||
resourceOptions.TokenClockSkew = TimeSpan.FromSeconds(authorityOptions.TokenClockSkewSeconds);
|
||||
|
||||
foreach (var audience in authorityOptions.Audiences)
|
||||
// Read collections directly from IConfiguration to work around
|
||||
// .NET Configuration.Bind() not populating IList<string> in nested init objects.
|
||||
var authSection = builder.Configuration.GetSection("Scheduler:Authority");
|
||||
|
||||
var cfgAudiences = authSection.GetSection("Audiences").Get<string[]>() ?? [];
|
||||
foreach (var audience in cfgAudiences)
|
||||
{
|
||||
resourceOptions.Audiences.Add(audience);
|
||||
}
|
||||
|
||||
foreach (var scope in authorityOptions.RequiredScopes)
|
||||
var cfgScopes = authSection.GetSection("RequiredScopes").Get<string[]>() ?? [];
|
||||
foreach (var scope in cfgScopes)
|
||||
{
|
||||
resourceOptions.RequiredScopes.Add(scope);
|
||||
}
|
||||
|
||||
foreach (var tenant in authorityOptions.RequiredTenants)
|
||||
var cfgTenants = authSection.GetSection("RequiredTenants").Get<string[]>() ?? [];
|
||||
foreach (var tenant in cfgTenants)
|
||||
{
|
||||
resourceOptions.RequiredTenants.Add(tenant);
|
||||
}
|
||||
|
||||
foreach (var network in authorityOptions.BypassNetworks)
|
||||
var cfgBypassNetworks = authSection.GetSection("BypassNetworks").Get<string[]>() ?? [];
|
||||
foreach (var network in cfgBypassNetworks)
|
||||
{
|
||||
resourceOptions.BypassNetworks.Add(network);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user