1 instantiation of OtlpApiKeyAuthenticationHandler
Aspire.Dashboard.Tests (1)
OtlpApiKeyAuthenticationHandlerTests.cs (1)
88var handler = new OtlpApiKeyAuthenticationHandler(
16 references to OtlpApiKeyAuthenticationHandler
Aspire.Dashboard (1)
DashboardWebApplication.cs (1)
670.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)
21var handler = await CreateAuthHandlerAsync(primaryApiKey: "abc", secondaryApiKey: null, otlpApiKeyHeader: null); 28Assert.Equal($"API key from '{OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName}' header is missing.", result.Failure.Message); 35var handler = await CreateAuthHandlerAsync(primaryApiKey: new string('!', 1000), secondaryApiKey: null, otlpApiKeyHeader: new string('!', 999)); 42Assert.Equal($"Incoming API key from '{OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName}' header doesn't match configured API key.", result.Failure.Message); 49var handler = await CreateAuthHandlerAsync(primaryApiKey: new string('!', 1000), secondaryApiKey: null, otlpApiKeyHeader: new string('!', 1000)); 66var handler = await CreateAuthHandlerAsync(primaryApiKey, secondaryApiKey, otlpApiKeyHeader); 75private static async Task<OtlpApiKeyAuthenticationHandler> CreateAuthHandlerAsync(string primaryApiKey, string? secondaryApiKey, string? otlpApiKeyHeader) 88var handler = new OtlpApiKeyAuthenticationHandler( 97httpContext.Request.Headers[OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName] = otlpApiKeyHeader;