google-cloud-rust
google-cloud-rust copied to clipboard
Feature parity between `Storage` client and other clients
The google_cloud_storage::client::Storage uses a reqwest::Client directly in its implementation instead of using gaxi::http::ReqwestClient like the GAPICs do.
I think I missed the discussion on why we chose to do this, but at a guess it is because Storage is the only client that does HTTP streaming, so there was no need to build that into the common gaxi layer.
The consequence is that we are missing some common features handled by the gaxi layer. Such as:
- Calculating and setting the
Host:header.- This is required to use a client in a private network such as VPC-SC.
- Cloud client library instrumentation for HTTP transport.
-
User-Agent:header. - etc. (this list may grow over time too)
We will need to do some level of refactoring to resolve this. It looks like either:
- add streaming support to
gaxi::http::ReqwestClient, and use that from withingoogle-cloud-storage - OR factor out configuration of a reqwest builder given options, and call into it from
google-cloud-storage