diff --git a/src/Microsoft.VisualStudio.Services.Agent/AdditionalMaskingRegexes.CredScan.cs b/src/Microsoft.VisualStudio.Services.Agent/AdditionalMaskingRegexes.CredScan.cs index db4de95383..42b5caaeaa 100644 --- a/src/Microsoft.VisualStudio.Services.Agent/AdditionalMaskingRegexes.CredScan.cs +++ b/src/Microsoft.VisualStudio.Services.Agent/AdditionalMaskingRegexes.CredScan.cs @@ -75,10 +75,6 @@ public static partial class AdditionalMaskingRegexes + @"npm_[0-9A-Za-z]{36}" // match + @"\b", // post-match - // NPM author keys. - @"\b" // pre-match - + @"npm_[0-9A-Za-z]{36}" // match - + @"\b", // post-match }; } } diff --git a/src/Microsoft.VisualStudio.Services.Agent/Constants.cs b/src/Microsoft.VisualStudio.Services.Agent/Constants.cs index b4de4b7972..b84419abb9 100644 --- a/src/Microsoft.VisualStudio.Services.Agent/Constants.cs +++ b/src/Microsoft.VisualStudio.Services.Agent/Constants.cs @@ -513,6 +513,7 @@ public static class Task Agent.Version, Agent.WorkFolder, Agent.WorkingDirectory, + Agent.EnableAdditionalMaskingRegexes, // Build variables Build.ArtifactStagingDirectory, Build.BinariesDirectory, diff --git a/src/Test/L0/Listener/JobDispatcherL0.cs b/src/Test/L0/Listener/JobDispatcherL0.cs index 3195a54975..3314f39b10 100644 --- a/src/Test/L0/Listener/JobDispatcherL0.cs +++ b/src/Test/L0/Listener/JobDispatcherL0.cs @@ -6,6 +6,7 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; +using Agent.Listener.Configuration; using Microsoft.TeamFoundation.DistributedTask.WebApi; using Microsoft.VisualStudio.Services.Agent.Listener; using Microsoft.VisualStudio.Services.WebApi; @@ -22,6 +23,7 @@ public sealed class JobDispatcherL0 private Mock _processInvoker; private Mock _agentServer; private Mock _configurationStore; + private Mock _featureFlagProvider; public JobDispatcherL0() { @@ -29,6 +31,7 @@ public JobDispatcherL0() _processInvoker = new Mock(); _agentServer = new Mock(); _configurationStore = new Mock(); + _featureFlagProvider = new Mock(); } private Pipelines.AgentJobRequestMessage CreateJobRequestMessage() @@ -53,6 +56,7 @@ public async void DispatchesJobRequest() var jobDispatcher = new JobDispatcher(); hc.SetSingleton(_configurationStore.Object); hc.SetSingleton(_agentServer.Object); + hc.SetSingleton(_featureFlagProvider.Object); hc.EnqueueInstance(_processChannel.Object); hc.EnqueueInstance(_processInvoker.Object);