1 instantiation of OtlpApiKeyAuthenticationHandler
Aspire.Dashboard.Tests (1)
OtlpApiKeyAuthenticationHandlerTests.cs (1)
89var handler = new OtlpApiKeyAuthenticationHandler(
16 references to OtlpApiKeyAuthenticationHandler
Aspire.Dashboard (1)
DashboardWebApplication.cs (1)
676.AddScheme<OtlpApiKeyAuthenticationHandlerOptions, OtlpApiKeyAuthenticationHandler>(OtlpApiKeyAuthenticationDefaults.AuthenticationScheme, o => { })
Aspire.Dashboard.Tests (15)
Integration\OtlpGrpcServiceTests.cs (4)
87{ OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, "WRONG" } 114{ OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, apiKey } 143{ OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, secondaryApiKey } 188{ OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, apiKey }
Integration\OtlpHttpServiceTests.cs (2)
142requestMessage.Headers.TryAddWithoutValidation(OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, "WRONG"); 170requestMessage.Headers.TryAddWithoutValidation(OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName, apiKey);
OtlpApiKeyAuthenticationHandlerTests.cs (9)
22var handler = await CreateAuthHandlerAsync(primaryApiKey: "abc", secondaryApiKey: null, otlpApiKeyHeader: null).DefaultTimeout(); 29Assert.Equal($"API key from '{OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName}' header is missing.", result.Failure.Message); 36var handler = await CreateAuthHandlerAsync(primaryApiKey: new string('!', 1000), secondaryApiKey: null, otlpApiKeyHeader: new string('!', 999)).DefaultTimeout(); 43Assert.Equal($"Incoming API key from '{OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName}' header doesn't match configured API key.", result.Failure.Message); 50var handler = await CreateAuthHandlerAsync(primaryApiKey: new string('!', 1000), secondaryApiKey: null, otlpApiKeyHeader: new string('!', 1000)).DefaultTimeout(); 67var handler = await CreateAuthHandlerAsync(primaryApiKey, secondaryApiKey, otlpApiKeyHeader).DefaultTimeout(); 76private static async Task<OtlpApiKeyAuthenticationHandler> CreateAuthHandlerAsync(string primaryApiKey, string? secondaryApiKey, string? otlpApiKeyHeader) 89var handler = new OtlpApiKeyAuthenticationHandler( 98httpContext.Request.Headers[OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName] = otlpApiKeyHeader;