betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
562 stars 61 forks source link

substituindo base64_string se necessário #172

Closed luizmmds closed 4 years ago

luizmmds commented 4 years ago

if the server allow base64 encoding, the info is saved on base64_string. Betamax does not verify this field. Some sensitive information was sending on the requests and betamax was not replacing its

hroncok commented 4 years ago

Any chance you know English? What problem does this solve exactly?

luizmmds commented 4 years ago

Sorry, I thought that the PR was for the company where I work hehe

sigmavirus24 commented 4 years ago

@luizmmds then this can be closed?

luizmmds commented 4 years ago

@sigmavirus24 I don't think so. I have this problem because I was sending Accept-Encoding: "gzip" on the request's header. Maybe, it would be interesting the possibility to replace the info inside base64_string too.

sigmavirus24 commented 4 years ago

@luizmmds we've rejected in the past because it becomes incredibly complex and can defeat the reproducibility that betamax strives for. To alter the Gzip compressed body, we'd have to decompress it, alter it, recompress it and then update the content-length header. We'd have to jump through that for every replay. So we'd do it once on recording (when creating the cassette) then every time you replay it, in order to substitute the contents in the body. Further, we would have to store extra information if we wanted to avoid decompressing every gzipped body to check for substitution. That would prevent our cassettes from being portable between Python and Ruby clients using VCR.

luizmmds commented 4 years ago

Hummm, okay. I'll close and think another solution. Thanks