nealrichardson / httptest2

Utilities for testing R 📦s that use httr2
https://enpiar.com/httptest2/
Other
26 stars 6 forks source link

fix: remove request from saved responses #38

Closed nealrichardson closed 2 months ago

nealrichardson commented 2 months ago

NEWS summary:

request is now removed when saving httr2_response objects. In earlier versions of httr2, requests were not included in responses, but in httr2 1.0.0, they were added in order to improve error messages. If you recorded any responses with httr2 >= 1.0 and httptest2 prior to this version, you may have leaked auth secrets: this would happen if your requests included auth information (as in an Authentication header), and the response was saved in a .R file, not simplified to .json or other response-body-only formats. Please inspect your recorded responses and invalidate any tokens that were exposed.

cc @jmaspons

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.50%. Comparing base (cff21ee) to head (2b8159d).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #38 +/- ## ======================================= Coverage 99.50% 99.50% ======================================= Files 14 14 Lines 400 401 +1 ======================================= + Hits 398 399 +1 Misses 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jmaspons commented 2 months ago

Should update vignette too https://github.com/nealrichardson/httptest2/blob/96b61db15b51917854914c9b0a67850e7830ff07/vignettes/redacting.Rmd#L19

nealrichardson commented 2 months ago

Well, it's true now, right? The request isn't saved in the mocks (anymore).

jmaspons commented 2 months ago

Yes, you are right