Add option to support 'Requester Pays' buckets
Closes #57
GCS has an option on buckets to make them a "Requester Pays" type of bucket: https://cloud.google.com/storage/docs/requester-pays. In short, this allows tracing of who/what is actually requesting an upload/download.
To query a bucket where "requester pays" is enabled, the userProject needs to be added in the URL. The GCS Ruby library provides this as an optional user_project keyword argument to Project#bucket: https://github.com/googleapis/google-cloud-ruby/blob/7523214b3c64f88db5e96269b397b066abf4b92e/google-cloud-storage/lib/google/cloud/storage/project.rb#L208-L216
When this is not passed, an error is thrown when listing/uploading files in a requester-pays bucket: Bucket is a requester pays bucket but no user project provided. (Google::Cloud::InvalidArgumentError)
This MR adds support for "requester pays"-buckets by accepting a user_project parameter (defaults to nil) on the Storage initializer, which is then used when calling Project#bucket.
Hi @renchap,
I've pushed a v3.4.0 tag & release commit on our fork: https://github.com/silverfin/shrine-google_cloud_storage/commit/e400dd1e1cd26880e7876a815ed7c27742aba5cd. Feel free to pull that in if that would help you.
For this PR, let me know if you have any remarks, or if there's something I can help with!