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