1 instantiation of OtlpApiKeyAuthenticationHandler
Aspire.Dashboard.Tests (1)
OtlpApiKeyAuthenticationHandlerTests.cs (1)
89
var handler = new
OtlpApiKeyAuthenticationHandler
(
16 references to OtlpApiKeyAuthenticationHandler
Aspire.Dashboard (1)
DashboardWebApplication.cs (1)
643
.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)
142
requestMessage.Headers.TryAddWithoutValidation(
OtlpApiKeyAuthenticationHandler
.ApiKeyHeaderName, "WRONG");
170
requestMessage.Headers.TryAddWithoutValidation(
OtlpApiKeyAuthenticationHandler
.ApiKeyHeaderName, apiKey);
OtlpApiKeyAuthenticationHandlerTests.cs (9)
22
var
handler = await CreateAuthHandlerAsync(primaryApiKey: "abc", secondaryApiKey: null, otlpApiKeyHeader: null).DefaultTimeout();
29
Assert.Equal($"API key from '{
OtlpApiKeyAuthenticationHandler
.ApiKeyHeaderName}' header is missing.", result.Failure.Message);
36
var
handler = await CreateAuthHandlerAsync(primaryApiKey: new string('!', 1000), secondaryApiKey: null, otlpApiKeyHeader: new string('!', 999)).DefaultTimeout();
43
Assert.Equal($"Incoming API key from '{
OtlpApiKeyAuthenticationHandler
.ApiKeyHeaderName}' header doesn't match configured API key.", result.Failure.Message);
50
var
handler = await CreateAuthHandlerAsync(primaryApiKey: new string('!', 1000), secondaryApiKey: null, otlpApiKeyHeader: new string('!', 1000)).DefaultTimeout();
67
var
handler = await CreateAuthHandlerAsync(primaryApiKey, secondaryApiKey, otlpApiKeyHeader).DefaultTimeout();
76
private static async Task<
OtlpApiKeyAuthenticationHandler
> CreateAuthHandlerAsync(string primaryApiKey, string? secondaryApiKey, string? otlpApiKeyHeader)
89
var
handler = new OtlpApiKeyAuthenticationHandler(
98
httpContext.Request.Headers[
OtlpApiKeyAuthenticationHandler
.ApiKeyHeaderName] = otlpApiKeyHeader;