feat(storage): add Cloud Storage bucket IP filtering samples#2221
feat(storage): add Cloud Storage bucket IP filtering samples#2221salilg-eng wants to merge 2 commits into
Conversation
|
Here is the summary of changes. You are about to add 5 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.
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.