feat(storage): add Cloud Storage bucket IP filtering samples#2221
feat(storage): add Cloud Storage bucket IP filtering samples#2221salilg-eng wants to merge 3 commits into
Conversation
|
Here is the summary of changes. You are about to add 6 region tags.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request introduces new PHP code samples for managing Cloud Storage bucket IP filtering rules, including enabling, disabling, retrieving, deleting, and listing IP filtering configurations, along with a lifecycle integration test. The feedback suggests improving the usability of the enable_ip_filtering sample by making the filter mode an optional parameter (defaulting to 'Enabled') and passing 'Disabled' explicitly in tests to prevent runner lockout. Additionally, it is recommended to specify the 'full' projection when listing buckets to ensure the ipFilter metadata is reliably returned.
kalragauri
left a comment
There was a problem hiding this comment.
Please also add samples for the following:
- Creating a bucket with IP filtering rules: https://docs.cloud.google.com/storage/docs/create-ip-filter
- Completely removing the IP filter configuration.
5c29008 to
64d9729
Compare
c5921be to
e4e0809
Compare
eddc681 to
2bffe4b
Compare
This PR add PHP code samples demonstrating how to manage IP filtering for Cloud Storage buckets.
What's included:
IpFilterTest.php) to cover the new snippets.Note on
enable_ip_filtering.php:I set the mode to
Disabledby default in the snippet (with an accompanying comment). If we actually set it toEnabledduring the automated tests, we risk locking the test runner out of the bucket and causing permission failures during the cleanup phase. Users can easily flip it toEnabledwhen adapting the code for their own use.