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