-
Notifications
You must be signed in to change notification settings - Fork 895
Update Microsoft.Security.Utilities.Core from v1.17.0 to v1.18.0 #5224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+419
−218
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d0bcce1
Update Microsoft.Security.Utilities.Core from v1.17.0 to v1.18.0
nguerrera 0fdb7d9
PR feedback: Don't change expressionmanager code path without feature…
nguerrera cf311e2
Merge branch 'master' into users/nguerrera/msuc-v1.18
nguerrera dba223f
Add comment
nguerrera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
using System; | ||
|
||
namespace Agent.Sdk.SecretMasking | ||
{ | ||
/// <summary> | ||
/// Rerpresents a raw secret masker without the features that <see | ||
/// cref="ILoggedSecretMasker"/> adds. | ||
/// </summary> | ||
public interface IRawSecretMasker : IDisposable | ||
{ | ||
int MinSecretLength { get; set; } | ||
|
||
void AddRegex(string pattern); | ||
void AddValue(string value); | ||
void AddValueEncoder(Func<string, string> encoder); | ||
string MaskSecrets(string input); | ||
void RemoveShortSecretsFromDictionary(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
using System; | ||
using Microsoft.TeamFoundation.DistributedTask.Logging; | ||
|
||
namespace Agent.Sdk.SecretMasking | ||
{ | ||
/// <summary> | ||
/// Legacy secret masker that dispatches to <see cref="SecretMasker"/> from | ||
/// 'Microsoft.TeamFoundation.DistributedTask.Logging'. | ||
/// </summary> | ||
public sealed class LegacySecretMasker : IRawSecretMasker | ||
{ | ||
private ISecretMasker _secretMasker; | ||
|
||
public LegacySecretMasker() | ||
{ | ||
_secretMasker = new SecretMasker(); | ||
} | ||
|
||
private LegacySecretMasker(ISecretMasker secretMasker) | ||
{ | ||
_secretMasker = secretMasker; | ||
} | ||
|
||
public int MinSecretLength | ||
{ | ||
get => _secretMasker.MinSecretLength; | ||
set => _secretMasker.MinSecretLength = value; | ||
} | ||
|
||
public void AddRegex(string pattern) | ||
{ | ||
_secretMasker.AddRegex(pattern); | ||
} | ||
|
||
public void AddValue(string value) | ||
{ | ||
_secretMasker.AddValue(value); | ||
} | ||
|
||
public void AddValueEncoder(Func<string, string> encoder) | ||
{ | ||
_secretMasker.AddValueEncoder(x => encoder(x)); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
(_secretMasker as IDisposable)?.Dispose(); | ||
_secretMasker = null; | ||
} | ||
|
||
public string MaskSecrets(string input) | ||
{ | ||
return _secretMasker.MaskSecrets(input); | ||
} | ||
|
||
public void RemoveShortSecretsFromDictionary() | ||
{ | ||
_secretMasker.RemoveShortSecretsFromDictionary(); | ||
} | ||
|
||
public LegacySecretMasker Clone() | ||
{ | ||
return new LegacySecretMasker(_secretMasker.Clone()); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.