-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Test Proxy] Centrally sanitize sensitive patterns for all tests #35196
Merged
Conversation
This file contains 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
mccoyp
force-pushed
the
proxy-sanitize-patterns
branch
2 times, most recently
from
April 13, 2024 06:23
16d2955
to
8594052
Compare
Core failures are unrelated and preexisting. |
mccoyp
force-pushed
the
proxy-sanitize-patterns
branch
2 times, most recently
from
April 15, 2024 01:47
2923b54
to
8101a07
Compare
API change check API changes are not detected in this pull request. |
xiangyan99
reviewed
Apr 15, 2024
mccoyp
force-pushed
the
proxy-sanitize-patterns
branch
from
April 15, 2024 23:03
515020d
to
f1b82b1
Compare
/azp run python - storage - ci |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
/azp run python - core - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
xiangyan99
approved these changes
Apr 16, 2024
3 tasks
HarshaNalluru
added a commit
to Azure/azure-sdk-for-js
that referenced
this pull request
Apr 16, 2024
### Packages impacted by this PR `@azure-tools/test-recorder` - Adding the central sanitizers ### Issues associated with this PR **References:** - Azure/azure-sdk-for-java#39700 - Azure/azure-sdk-for-python#35196 - And the patterns found ### Describe the problem that is addressed by this PR - Introducing fallback sanitizers into the test recorder to handle potential secret leaks. - The new sanitizers are designed to work in conjunction with the existing `handleEnvSetup` mechanism and the fake secrets. - The sanitizers include: - `BodyKeySanitizers` that redact sensitive information in the JSON body of the requests. - `FindReplaceSanitizers` that redact sensitive information based on provided regular expressions. - `HeaderSanitizers` that redact sensitive information in the headers of the requests. ## Tests I've ran the tests for the following and they work fine - [x] recorder - [x] template - [x] notification-hubs (needed to make a few fixes for browser tests in notification hubs which do feel like unrelated to this PR, but fixing them here anyway.) ___Currently only these three packages depend on recorder v4.___ ## Future work (future PRs) - Once this PR is merged, cherrypick the commit and release a hotfix 3.x version - Add more tests at some point
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This adds a
Sanitizer
enum and batch sanitizer registration method --add_batch_sanitizers
-- that make it possible to easily set a number of sanitizers in a single request.Sanitizer registration has been centralized to take place just after the test proxy is started up and before recordings are loaded up, meaning that they will apply to the entire session.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines