RESTStream: PreparedRequest - Be compatible with "standard" Session method behaviour
Summary
The requests
library allows usage of certain environment variables to control its behaviour.
One of these environment variables is REQUESTS_CA_BUNDLE
that is used to override the default CA bundle that ships with the requests
library. Which is a needed feature in order to work with SSL-inspection devices and other 'man-in-the-middle' proxy systems.
As per requests
documentation, in order to provide the same behaviour in regards to environment variables when using the PreparedRequest
class instead of the Session
class, additional preparation is needed via the merge_environment_settings
API method, which provides the compatible behaviour.
Proposed benefits
Provide the same behaviour to Meltano SDK users that is already afforded to users of the requests
library.
Proposal details
Use merge_environment_settings
API before calling send
on the PreparedRequest
object.
Best reasons not to build
Existing users who are relying on this unexpected behaviour (i.e. that Meltano RESTStream class is "ignoring" the otherwise respected REQUESTS_CA_BUNDLE
, CURL_CA_BUNDLE
, HTTP_PROXY
, HTTPS_PROXY
and NO_PROXY
environment variables) might have their set ups broken by enabling this usually expected behaviour of the standard requests
functionality.