Apply Sanitizers Immediately
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 115
Description
@timovv was investigating Azure/azure-sdk-for-js#18222
Essentially, `sanitizers` apply during `record` when we stop the recording. During playback, sanitizers are applied to each request prior to matching against the recordings.
There are complicating factors here. We have sanitizers that rely on more than just an individual request/response pair. See `ContinuationSanitizer`. We should properly apply those sanitizers that _do_ operate on individual entries during the recording, then apply all session-level sanitizers when saving to disk.
This makes sense because to _not_ apply individual sanitizers to each request means that if a sanitizer is added _while a recording is in progress_ than it should only apply to the requests _after_ it was added. Example Timeline below
- `Admin/AddSanitizer` to add sanitizer A
- `Record/Start` -> returns recordingid
- `Record Request 1`
- `Admin/AddSanitizer` to add sanitizer B
- `Record Request 2`
Request 1 should be sanitized by `A` only. Request 2 should be sanitized by `A` AND `B`.
With the way the proxy currently works, `A` and `B` will apply to both regardless.
Contributor guide
Assessment
This issue has not been assessed yet.