From 0fdfcd590f0df2dd0d9491f9dc34e50c3abb48be Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Thu, 4 Apr 2024 21:43:41 +1100 Subject: [PATCH] Make CompareHelpers shared --- src/Aspire.Dashboard/Aspire.Dashboard.csproj | 1 + .../OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs | 1 - src/{Aspire.Dashboard/Utils => Shared}/CompareHelpers.cs | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/{Aspire.Dashboard/Utils => Shared}/CompareHelpers.cs (93%) diff --git a/src/Aspire.Dashboard/Aspire.Dashboard.csproj b/src/Aspire.Dashboard/Aspire.Dashboard.csproj index 8591b5297e..4080271b4a 100644 --- a/src/Aspire.Dashboard/Aspire.Dashboard.csproj +++ b/src/Aspire.Dashboard/Aspire.Dashboard.csproj @@ -189,6 +189,7 @@ Protos\resource_service.proto + diff --git a/src/Aspire.Dashboard/Authentication/OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs b/src/Aspire.Dashboard/Authentication/OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs index 29a7697f86..5725a150fa 100644 --- a/src/Aspire.Dashboard/Authentication/OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs +++ b/src/Aspire.Dashboard/Authentication/OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs @@ -3,7 +3,6 @@ using System.Text.Encodings.Web; using Aspire.Dashboard.Configuration; -using Aspire.Dashboard.Utils; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Options; diff --git a/src/Aspire.Dashboard/Utils/CompareHelpers.cs b/src/Shared/CompareHelpers.cs similarity index 93% rename from src/Aspire.Dashboard/Utils/CompareHelpers.cs rename to src/Shared/CompareHelpers.cs index 56b325daf7..4bc8a3fa20 100644 --- a/src/Aspire.Dashboard/Utils/CompareHelpers.cs +++ b/src/Shared/CompareHelpers.cs @@ -6,12 +6,12 @@ using System.Security.Cryptography; using System.Text; -namespace Aspire.Dashboard.Utils; +namespace Aspire; internal static class CompareHelpers { // This method is used to compare two keys in a way that avoids timing attacks. - public static bool CompareKey(byte[] expectedKeyBytes, string requestKey) + internal static bool CompareKey(byte[] expectedKeyBytes, string requestKey) { const int StackAllocThreshold = 256;