feat(storage): add bucket IP filtering samples and tests - #14328
nidhiii-27 wants to merge 4 commits into
Conversation
Add Java code samples and integration tests demonstrating Cloud Storage Bucket IP filtering. Fixes: b/544985518 [Generated-by: AI]
There was a problem hiding this comment.
Code Review
This pull request introduces several Java code snippets and an integration test demonstrating how to manage GCS bucket IP filtering configurations. Specifically, it adds functionality to create, enable, disable, retrieve, list, and delete IP filtering rules on a bucket. Since there are no review comments, I have no feedback to provide.
| public class IpFilterTest extends TestBase { | ||
|
|
||
| @Test | ||
| public void testBucketIpFilterLifecycle() throws Exception { |
There was a problem hiding this comment.
Can we break this lifecycle test into smaller tests. We should generally try sticking to one behavior per test go/tott/726 so its easier to debug if one specific step fails.
There was a problem hiding this comment.
Done
Co-authored by AI Agent
| vpcSources.addAll(ipFilter.getVpcNetworkSources()); | ||
| } | ||
| if (vpcNetworkToDelete != null) { | ||
| Iterator<VpcNetworkSource> iterator = vpcSources.iterator(); |
There was a problem hiding this comment.
Can we simplify the explicit Iterator loop here by calling removeIf directly on the vpcSources list ?
There was a problem hiding this comment.
Done
Co-authored by AI Agent
- Simplify VPC network source removal in DeleteBucketIpFilter using removeIf - Break IpFilterTest lifecycle test into individual single-behavior unit/integration tests [Generated-by: AI]
Synchronize samples-bucket-ip-filter-java with main to resolve the Kokoro FetchFromGithub SCM checkout failure on PR #14328. [Generated-by: AI]
Add Java code samples and integration tests demonstrating Cloud Storage Bucket IP filtering:
CreateBucketIpFilter.java)EnableBucketIpFilter.java)GetBucketIpFilter.java)DeleteBucketIpFilter.java)DisableBucketIpFilter.java)ListBucketsIpFilter.java)IpFilterTest.java)Fixes: b/544985518