You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for making the package! this makes it a lot easier for testing HTTP requests indeed. But I find that I'm not able to hide credentials that are not inside the header, my use case is the IBMQClient.jl, where I will need to use my user token to get an access token from the REST API, thus the response body will contain this credential, I wish to replace that
with a fake credential so that I can test it in CI, I currently have to do it manually since I didn't find any options to do so.
I tried to implement it myself, but due to my limited knowledge of the implementation, I didn't have any luck. it would be nice if this package could support this.
The text was updated successfully, but these errors were encountered:
I think we could do this in a nice way with a post-response recording hook, basically letting you pass in a mutating function where you could modify the response to your liking before it gets persisted to disk in recording mode.
Actually, that combined with a pre-request playback hook (modifying request parameters before comparing to the saved request) could replace the current ignore_query and ignore_headers for a more unified API.
For your use cases the hook might look like this:
functiontransform_before_save(r)
body = JSON.parse(String(r.body))
body["access_token"] ="<redacted>"
r.body =Vector{UInt8}(json(body))
end
I'll have to do some more thinking about how to make this all work nicely, but it's definitely a use case that we should support.
Thanks for making the package! this makes it a lot easier for testing HTTP requests indeed. But I find that I'm not able to hide credentials that are not inside the header, my use case is the IBMQClient.jl, where I will need to use my user token to get an access token from the REST API, thus the response body will contain this credential, I wish to replace that
with a fake credential so that I can test it in CI, I currently have to do it manually since I didn't find any options to do so.
I tried to implement it myself, but due to my limited knowledge of the implementation, I didn't have any luck. it would be nice if this package could support this.
The text was updated successfully, but these errors were encountered: