Skip to content
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

We add from JsonPathSanitizers twice #27310

Closed
heaths opened this issue Mar 2, 2022 · 0 comments · Fixed by #27311
Closed

We add from JsonPathSanitizers twice #27310

heaths opened this issue Mar 2, 2022 · 0 comments · Fixed by #27311
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.

Comments

@heaths
Copy link
Member

heaths commented Mar 2, 2022

private async Task AddProxySanitizersAsync()
{
foreach (string header in _recordedTestBase.SanitizedHeaders)
{
await _proxy.Client.AddHeaderSanitizerAsync(new HeaderRegexSanitizer(header, Sanitized), RecordingId);
}
foreach (var header in _recordedTestBase.HeaderRegexSanitizers)
{
await _proxy.Client.AddHeaderSanitizerAsync(header, RecordingId);
}
foreach (var (header, queryParameter) in _recordedTestBase.SanitizedQueryParametersInHeaders)
{
await _proxy.Client.AddHeaderSanitizerAsync(
HeaderRegexSanitizer.CreateWithQueryParameter(header, queryParameter, Sanitized),
RecordingId);
}
foreach (string jsonPath in _recordedTestBase.JsonPathSanitizers)
{
await _proxy.Client.AddBodyKeySanitizerAsync(new BodyKeySanitizer(Sanitized) { JsonPath = jsonPath }, RecordingId);
}
foreach (UriRegexSanitizer sanitizer in _recordedTestBase.UriRegexSanitizers)
{
await _proxy.Client.AddUriSanitizerAsync(sanitizer, RecordingId);
}
foreach (string queryParameter in _recordedTestBase.SanitizedQueryParameters)
{
await _proxy.Client.AddUriSanitizerAsync(
UriRegexSanitizer.CreateWithQueryParameter(queryParameter, Sanitized),
RecordingId);
}
foreach (string path in _recordedTestBase.JsonPathSanitizers)
{
await _proxy.Client.AddBodyKeySanitizerAsync(new BodyKeySanitizer(Sanitized) { JsonPath = path }, RecordingId);
}
foreach (BodyRegexSanitizer sanitizer in _recordedTestBase.BodyRegexSanitizers)
{
await _proxy.Client.AddBodyRegexSanitizerAsync(sanitizer, RecordingId);
}
}

In TestRecording.cs we loop over _recordedTestBase.JsonPathSanitizers twice.

@heaths heaths added Client This issue points to a problem in the data-plane of the library. Azure.Core labels Mar 2, 2022
heaths added a commit to heaths/azure-sdk-for-net that referenced this issue Mar 2, 2022
heaths added a commit that referenced this issue Mar 2, 2022
* Normalize LinkBase for Azure.Core shared files

* Revert changes for Azure/azure-sdk-tools#2434

* Compare recorded bodies

Seems in the course of creating predictable results, I inadvertently fixed #11634.

* Don't enumerate JsonPathSanitizers twice

Fixes #27310
yanfa317 pushed a commit to yanfa317/azure-sdk-for-net that referenced this issue Mar 8, 2022
* Normalize LinkBase for Azure.Core shared files

* Revert changes for Azure/azure-sdk-tools#2434

* Compare recorded bodies

Seems in the course of creating predictable results, I inadvertently fixed Azure#11634.

* Don't enumerate JsonPathSanitizers twice

Fixes Azure#27310
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants