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