[Test-Proxy] Dynamically Create `Body` content and stream back
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 143
Description
This issue covers work that would be necessary on the test-proxy side to support Azure/azure-sdk-for-net#6781.
During `playback`. We need a way to indicate to the test-proxy that the response is of long content, and can be generated randomly.
The primary sticking point here is that we obviously can't just examine the body length and start substituting random content. Clients need to indicate to the test-proxy that a response body should not be stored.
To effectively generate random data, we need a few pieces of information.
1. What does this the random content look like? (this would come down to which implementation is selected)
2. What is the seed for the random content, if any? How does it get used during playback?
3. Some additional piece of information on the exact request whos response body will not be stored.
As far as I can tell, this comes down to two additional headers on content whos body should be substituted at playback time.
1. `x-recording-seed-generator`
1. The "implementation". EG, generates random content of `"AAABBB"` vs `{"A":"B"}`
2. `x-recording-seed`
1. The `seed` provided to the random generator. If one is necessary.
2. The "default" seed for the random implementations will be settable via `SetRecordingOptions`
During the recording, recognition of these headers should result in exactly two actions.
1. The `response body` should not be saved into the recording
3. The `response` side of the entry should contain two custom properties. The `random seed`, and the `random implementation`.
During `playback`, the `test-proxy` should key off these additional two properties in the recording, and take the appropriate action to create the response bodies dynamically.
@JoshLove-msft I'm not jumping on this right now, but I'd be interested to talk about what this would look like.
Contributor guide
Assessment
This issue has not been assessed yet.