13 references to ApiKeyHeaderName
Aspire.Dashboard (4)
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (4)
26
if (Context.Request.Headers.TryGetValue(
ApiKeyHeaderName
, out var apiKey))
31
return Task.FromResult(AuthenticateResult.Fail($"Multiple '{
ApiKeyHeaderName
}' headers in request."));
38
return Task.FromResult(AuthenticateResult.Fail($"Incoming API key from '{
ApiKeyHeaderName
}' header doesn't match configured API key."));
44
return Task.FromResult(AuthenticateResult.Fail($"API key from '{
ApiKeyHeaderName
}' header is missing."));
Aspire.Dashboard.Tests (9)
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 (3)
29
Assert.Equal($"API key from '{OtlpApiKeyAuthenticationHandler.
ApiKeyHeaderName
}' header is missing.", result.Failure.Message);
43
Assert.Equal($"Incoming API key from '{OtlpApiKeyAuthenticationHandler.
ApiKeyHeaderName
}' header doesn't match configured API key.", result.Failure.Message);
98
httpContext.Request.Headers[OtlpApiKeyAuthenticationHandler.
ApiKeyHeaderName
] = otlpApiKeyHeader;