12 instantiations of DashboardOptions
Aspire.Dashboard (1)
DashboardWebApplication.cs (1)
451
dashboardOptions = new
DashboardOptions
();
Aspire.Dashboard.Components.Tests (6)
Pages\ConsoleLogsTests.cs (1)
166
Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new
DashboardOptions
()));
Pages\StructuredLogsTests.cs (1)
178
Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new
DashboardOptions
()));
Pages\TraceDetailsTests.cs (1)
170
Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new
DashboardOptions
()));
Shared\MetricsSetupHelpers.cs (1)
77
context.Services.AddSingleton<IOptions<DashboardOptions>>(Options.Create(new
DashboardOptions
()));
Shared\ResourceSetupHelpers.cs (1)
84
context.Services.AddSingleton(Options.Create(new
DashboardOptions
()));
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
254
Options.Create(new
DashboardOptions
{ TelemetryLimits = options }));
Aspire.Dashboard.Tests (5)
DashboardOptionsTests.cs (1)
15
return
new
()
Integration\DashboardClientAuthTests.cs (1)
117
var options = new
DashboardOptions
Model\DashboardClientTests.cs (1)
28
var options = new
DashboardOptions
OtlpApiKeyAuthenticationHandlerTests.cs (1)
78
var options = new
DashboardOptions
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
254
Options.Create(new
DashboardOptions
{ TelemetryLimits = options }));
76 references to DashboardOptions
Aspire.Dashboard (44)
Authentication\FrontendCompositeAuthenticationHandler.cs (1)
13
IOptionsMonitor<
DashboardOptions
> dashboardOptions,
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (2)
15
private readonly IOptionsMonitor<
DashboardOptions
> _dashboardOptions;
17
public OtlpApiKeyAuthenticationHandler(IOptionsMonitor<
DashboardOptions
> dashboardOptions, IOptionsMonitor<OtlpApiKeyAuthenticationHandlerOptions> options, ILoggerFactory logger, UrlEncoder encoder) : base(options, logger, encoder)
Authentication\OtlpCompositeAuthenticationHandler.cs (1)
16
IOptionsMonitor<
DashboardOptions
> dashboardOptions,
Components\Controls\UserProfile.razor.cs (3)
42
if (
DashboardOptions
.CurrentValue.Frontend.AuthMode == FrontendAuthMode.OpenIdConnect)
51
_name = claimsIdentity.FindFirst(
DashboardOptions
.CurrentValue.Frontend.OpenIdConnect.GetNameClaimTypes());
58
_username = claimsIdentity.FindFirst(
DashboardOptions
.CurrentValue.Frontend.OpenIdConnect.GetUsernameClaimTypes());
Components\Pages\StructuredLogs.razor.cs (2)
116
if (
DashboardOptions
.Value.TelemetryLimits.MaxLogCount == logs.TotalItemCount && !TelemetryRepository.HasDisplayedMaxLogLimitMessage)
121
options.Body = string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.StructuredLogs.MessageExceededLimitBody)],
DashboardOptions
.Value.TelemetryLimits.MaxLogCount);
Components\Pages\Traces.razor.cs (2)
120
if (
DashboardOptions
.Value.TelemetryLimits.MaxTraceCount == traces.TotalItemCount && !TelemetryRepository.HasDisplayedMaxTraceLimitMessage)
125
options.Body = string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.MessageExceededLimitBody)],
DashboardOptions
.Value.TelemetryLimits.MaxTraceCount);
Configuration\PostConfigureDashboardOptions.cs (3)
10
public sealed class PostConfigureDashboardOptions : IPostConfigureOptions<
DashboardOptions
>
25
public void PostConfigure(string? name,
DashboardOptions
options)
27
_logger.LogDebug($"PostConfigure {nameof(
DashboardOptions
)} with name '{name}'.");
Configuration\ValidateDashboardOptions.cs (3)
10
public sealed class ValidateDashboardOptions : IValidateOptions<
DashboardOptions
>
23
public ValidateOptionsResult Validate(string? name,
DashboardOptions
options)
25
_logger.LogDebug($"Validating {nameof(
DashboardOptions
)}.");
DashboardEndpointsBuilder.cs (2)
17
public static void MapDashboardApi(this IEndpointRouteBuilder endpoints,
DashboardOptions
dashboardOptions)
21
endpoints.MapPost("/api/validatetoken", async (string token, HttpContext httpContext, IOptionsMonitor<
DashboardOptions
> dashboardOptions) =>
DashboardWebApplication.cs (17)
49
private readonly IOptionsMonitor<
DashboardOptions
> _dashboardOptionsMonitor;
95
public IOptionsMonitor<
DashboardOptions
> DashboardOptionsMonitor => _dashboardOptionsMonitor;
154
builder.Services.AddOptions<
DashboardOptions
>()
157
builder.Services.AddSingleton<IPostConfigureOptions<
DashboardOptions
>, PostConfigureDashboardOptions>();
158
builder.Services.AddSingleton<IValidateOptions<
DashboardOptions
>, ValidateDashboardOptions>();
160
if (!TryGetDashboardOptions(builder, dashboardConfigSection, out
var
dashboardOptions, out var failureMessages))
165
_dashboardOptionsMonitor = _app.Services.GetRequiredService<IOptionsMonitor<
DashboardOptions
>>();
272
_dashboardOptionsMonitor = _app.Services.GetRequiredService<IOptionsMonitor<
DashboardOptions
>>();
331
var
options = _app.Services.GetRequiredService<IOptionsMonitor<
DashboardOptions
>>().CurrentValue;
446
/// Load <see cref="
DashboardOptions
"/> from configuration without using DI. This performs
449
private static bool TryGetDashboardOptions(WebApplicationBuilder builder, IConfigurationSection dashboardConfigSection, [NotNullWhen(true)] out
DashboardOptions
? dashboardOptions, [NotNullWhen(false)] out IEnumerable<string>? failureMessages)
469
private void ConfigureKestrelEndpoints(WebApplicationBuilder builder,
DashboardOptions
dashboardOptions)
637
private static void ConfigureAuthentication(WebApplicationBuilder builder,
DashboardOptions
dashboardOptions)
655
var
options = context.HttpContext.RequestServices.GetRequiredService<IOptions<
DashboardOptions
>>().Value;
804
static string ConfigureDefaultAuthScheme(
DashboardOptions
dashboardOptions)
Model\ValidateTokenMiddleware.cs (4)
17
private readonly IOptionsMonitor<
DashboardOptions
> _options;
20
public ValidateTokenMiddleware(RequestDelegate next, IOptionsMonitor<
DashboardOptions
> options, ILogger<ValidateTokenMiddleware> logger)
39
var dashboardOptions = context.RequestServices.GetRequiredService<IOptionsMonitor<
DashboardOptions
>>();
81
public static async Task<bool> TryAuthenticateAsync(string incomingBrowserToken, HttpContext httpContext, IOptionsMonitor<
DashboardOptions
> dashboardOptions)
Otlp\Storage\TelemetryRepository.cs (1)
56
public TelemetryRepository(ILoggerFactory loggerFactory, IOptions<
DashboardOptions
> dashboardOptions)
ResourceService\DashboardClient.cs (2)
53
private readonly
DashboardOptions
_dashboardOptions;
74
IOptions<
DashboardOptions
> dashboardOptions,
ResourceService\DashboardClientStatus.cs (1)
9
internal sealed class DashboardClientStatus(IOptions<
DashboardOptions
> dashboardOptions) : IDashboardClientStatus
Aspire.Dashboard.Components.Tests (5)
Layout\MainLayoutTests.cs (1)
141
Services.Configure<
DashboardOptions
>(o => o.Otlp.AuthMode = OtlpAuthMode.Unsecured);
Pages\ConsoleLogsTests.cs (1)
166
Services.AddSingleton<IOptions<
DashboardOptions
>>(Options.Create(new DashboardOptions()));
Pages\StructuredLogsTests.cs (1)
178
Services.AddSingleton<IOptions<
DashboardOptions
>>(Options.Create(new DashboardOptions()));
Pages\TraceDetailsTests.cs (1)
170
Services.AddSingleton<IOptions<
DashboardOptions
>>(Options.Create(new DashboardOptions()));
Shared\MetricsSetupHelpers.cs (1)
77
context.Services.AddSingleton<IOptions<
DashboardOptions
>>(Options.Create(new DashboardOptions()));
Aspire.Dashboard.Tests (27)
DashboardOptionsTests.cs (18)
12
private static
DashboardOptions
GetValidOptions()
44
var
options = GetValidOptions();
56
var
options = GetValidOptions();
68
var
options = GetValidOptions();
82
var
options = GetValidOptions();
98
var
options = GetValidOptions();
110
var
options = GetValidOptions();
124
var
options = GetValidOptions();
139
var
options = GetValidOptions();
154
var
options = GetValidOptions();
168
var
options = GetValidOptions();
182
var
options = GetValidOptions();
195
var
options = GetValidOptions();
212
var
options = GetValidOptions();
227
var
options = GetValidOptions();
239
var
options = GetValidOptions();
255
var
options = GetValidOptions();
268
var
options = GetValidOptions();
Integration\DashboardClientAuthTests.cs (2)
115
Action<
DashboardOptions
>? configureOptions = null)
117
var
options = new DashboardOptions
Integration\OtlpGrpcServiceTests.cs (2)
198
var tcs = new TaskCompletionSource<
DashboardOptions
>(TaskCreationOptions.RunContinuationsAsynchronously);
221
var
options = await tcs.Task;
Middleware\ValidateTokenMiddlewareTests.cs (1)
78
services.Configure<
DashboardOptions
>(o =>
Model\DashboardClientTests.cs (2)
22
private readonly IOptions<
DashboardOptions
> _dashboardOptions;
28
var
options = new DashboardOptions
OtlpApiKeyAuthenticationHandlerTests.cs (2)
78
var
options = new DashboardOptions
90
new TestOptionsMonitor<
DashboardOptions
>(options),