Skip to content

Commit

Permalink
[Unified Recorder] AddSanitizer (#17379)
Browse files Browse the repository at this point in the history
* connection string sanitizer

* removeHeaderSanitizer

* add server

* rename as unit tests

* update integration test commands

* lock file

* sanitizer tests

* lock file

* del;ete sanitizer test file

* build failures

* sanitizer starter tests

* export setEnvironmentVariables from recorder

* sanitizer and related changes

* pass client.start param

* recorder.start takes options

* update karma.conf

* core-v1 and core-v2 tests with sanitizer

* recordings

* remnove console.log

* getRealAndFakePairs rename

* session file not needed

* doc comment

* temp-commands

* sanitizer APIs

* add more routes to the server

* lock file

* tests with the local server

* node recordings

* browser counterparts

* echo skipped

* comment out

* UriRegexSanitizer

* UriSubscriptionIdSanitizer

* continuationSanitizer

* headerRegexSanitizers

* Codespaces

* UriRegexSanitizer

* simplify UriRegexSanitizer test

* UriSubscriptionIdSanitizer

* recordigns

* lock file

* unneeded commented code

* ResetSanitizer did not work as expected

* groupForReplace and transformsInfo

* adding sanitizer to start method

* recordings

* some docs and handleEnvSetupForPlayback

* lock file

* docs

* changelog

* changelog

* comments

* Daniel's feedback

* lock file

* ProxyToolSanitizers, sanitizerKeywordMapping

* refactor

* add comment

* more docs

* test-proxy starter code for starting

* Revert "test-proxy starter code for starting"

This reverts commit 49a2d68.

* Jeremy's and Daniels's feedback

* part feedback from Will

* mistype

* exclude Exclude from Exclude<T, undefined> to not have Exclude

* Simplify getKeyValuePair method

* getConnStringAsJSON

Co-authored-by: Codespaces <codespaces@github.com>
  • Loading branch information
HarshaNalluru and Codespaces authored Oct 22, 2021
1 parent f975db1 commit 88791cd
Show file tree
Hide file tree
Showing 41 changed files with 3,273 additions and 1,181 deletions.
2,411 changes: 1,319 additions & 1,092 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions sdk/test-utils/recorder-new/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@

## 1.0.0 (Unreleased)

## 2021-10-15

[#17379](https://github.com/Azure/azure-sdk-for-js/pull/17379)

- Added `addSanitizers` method to support
- BodyKeySanitizer
- BodyRegexSanitizer
- GeneralRegexSanitizer
- HeaderRegexSanitizer
- RemoveHeaderSanitizer
- UriRegexSanitizer
- UriSubscriptionIdSanitizer
- Connection String sanitizer
- Adds `SanitizerOptions`, env setup for playback as the options of the `start()` method
- Applies `generalRegexSanitizers` on the env setup for playback options by default to eliminate any plain text secrets in the recordings
- Testing - All the tests are run in the `recorder-new` folder run in all three modes - "record", "playback" and "live" everytime the test commands are run

## 2021-09-27

- `TestProxyClient` now takes the test context to determine the location of the recordings. [#17388](https://github.com/Azure/azure-sdk-for-js/pull/17388)
[#17388](https://github.com/Azure/azure-sdk-for-js/pull/17388)

- `TestProxyClient` now takes the test context to determine the location of the recordings.
- Adds a server for the tests, to play the role of an actual service to be able to test the proxy-tool end-to-end.
[#17388](https://github.com/Azure/azure-sdk-for-js/pull/17388)

## 2021-07-17

Expand Down
6 changes: 4 additions & 2 deletions sdk/test-utils/recorder-new/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"test:browser": "npm run clean && npm run build && npm run temp-integration-test:browser",
"test:node": "npm run clean && npm run build:test && npm run temp-integration-test:node",
"test": "npm run clean && npm run build:test && npm run unit-test",
"docs": "echo Skipped."
},
Expand Down Expand Up @@ -86,6 +86,7 @@
"@types/node": "^12.0.0",
"@types/mock-require": "~2.0.0",
"@types/mock-fs": "~4.10.0",
"@types/uuid": "^8.3.1",
"chai": "^4.2.0",
"concurrently": "^6.2.1",
"cross-env": "7.0.3",
Expand Down Expand Up @@ -121,6 +122,7 @@
"tslib": "^2.2.0",
"ts-node": "^9.0.0",
"typescript": "~4.2.0",
"uuid": "^8.3.2",
"xhr-mock": "^2.4.1"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 88791cd

Please sign in to comment.