feat(storage): support bucket ip filter - #34612
Conversation
|
Here is the summary of changes. You are about to add 6 region tags.
This comment is generated by snippet-bot.
|
Removed redundant explanation about uniform bucket-level access.
Removed unnecessary line break before accessing the IP filter.
There was a problem hiding this comment.
We cannot access the bucket after IP filter is enabled, right? So, we can still test enabling part.
There was a problem hiding this comment.
in tests we are testing for disabled only, in samples user can change it according to there requirement
added this particular test as it was requested
| # limitations under the License. | ||
|
|
||
| # [START storage_enable_bucket_ip_filter] | ||
| def enable_bucket_ip_filter bucket_name:, mode: "Enabled" |
There was a problem hiding this comment.
If we're enabling the ip_filter, we won't need to accept mode separately. Just like we have it for previous sample "disabling_ip_filter` .
| ip_filter = { | ||
| mode: "Disabled", | ||
| public_network_source: { | ||
| allowed_ip_cidr_ranges: [ |
There was a problem hiding this comment.
Shouldn't public_network_source be nil and vpc_network_sources be [] when disabling ip_filter?
| mode: mode, | ||
| allow_all_service_agent_access: true, | ||
| public_network_source: { | ||
| allowed_ip_cidr_ranges: ["0.0.0.0/0", "::/0"] |
There was a problem hiding this comment.
Can you please also add a test to include multiple allowed_ip_cidr_ranges ?
|
QQ: Do we not use |
This pull request introduces the capability to configure IP filters for Google Cloud Storage buckets directly through the Ruby client library. It extends existing bucket management functionalities to allow specifying IP filter settings during bucket creation and provides methods to update these settings on existing buckets. The changes also include new sample code to demonstrate the usage of this feature, although some debugging code is still present, suggesting it is a work-in-progress.
Highlights
ip_filtergetter and setter methods to theGoogle::Cloud::Storage::Bucketclass, enabling programmatic access and modification of IP filter settings.create_bucketmethod inGoogle::Cloud::Storage::Projectto accept anip_filterparameter, allowing IP filter configuration during bucket creation.