-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bypass unnecessary GCS storage.buckets.get permission #516
Bypass unnecessary GCS storage.buckets.get permission #516
Conversation
storage.buckets.get
permission
Thank you for pointing this out @gelioz. @petedannemann What do you think? |
Looks great to me. Nice work @gelioz |
It would be worth looking into if EDIT: Looks like it is |
Never mind, I think we need the blob metadata to check if the blob exists right below that. |
Merged. Congrats on your first contribution to smart_open, @gelioz 👍 |
We don't really have a schedule. Perhaps in a month or so, once we've accumulated some changes to release. Why do you ask @pquentin ? |
Thanks! I ask, because since it's in a month, that means I'll upload that master version to our private devpi server. Otherwise, I would just have skipped our failing test for a few days. As an open source maintainer myself, I don't want to put more pressure on you. :) |
Having this in a release would help us as well. It's been well over a month, so maybe this is a good time to put out a 2.1.1? |
OK, https://pypi.org/project/smart-open/2.1.1/ Thank you for your patience. |
Motivation
smart_open.gcs.Reader
class usesgoogle.cloud.storage.Client.get_bucket
method which not only returns instance ofgoogle.cloud.storage.Blob
, but also performs GET request to retrieve bucket metadata.This request requires Cloud IAM
storage.buckets.get
permission which isn't a part of predefined "Storage Object Viewer" IAM role and this cause unjustifiable troubles with roles management:Since retrieved bucket metadata is not used at all,
google.cloud.storage.Client.get_bucket
method can be safely replaced withgoogle.cloud.storage.Client.bucket
method which not performs API call to bucket endpoint and returns the samegoogle.cloud.storage.Blob
instance.Checklist
Before you create the PR, please make sure you have: