Skip to content
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

bug-1881575: only require objectUser permissions for GCS #1001

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Conversation

relud
Copy link
Member

@relud relud commented Apr 29, 2024

when deploying antenna in stage, i found it was crashing when app.verify() was called, and tracked that to not having get bucket permissions.

We could grant get bucket permissions, but it seems unnecessary when we could only use the permissions we need.

@relud relud requested a review from willkg April 29, 2024 20:40
@relud relud requested a review from a team as a code owner April 29, 2024 20:40
self.client.get_bucket(self.bucket)
# check if a blob exists to verify GCS is up and we can connect to it,
# without exceeding the permissions granted by roles/storage.objectUser
self.client.bucket(self.bucket).blob(generate_test_filepath()).exists()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the test file always exist? I'm not sure I understand this test and what will happen in this try/except block that catches Exception.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test file won't exist, but that's fine because the exists function returns a boolean unless it lacks permissions

Copy link
Contributor

@willkg willkg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as far as I can tell.

@relud relud merged commit d1d6a39 into main Apr 30, 2024
2 checks passed
@relud relud deleted the gcs-object-user branch April 30, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants