S3: preserve repeated object path slashes with a per-driver option - #2189
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
Addresses apache#1654 without changing the global URL normalization default. Generated-by: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses #1654 with the per-driver opt-in discussed in the issue. S3 object names may contain leading or repeated slashes, but the default connection URL normalization can collapse them. Deleting such a key can return success for a different path while leaving the intended object in the bucket.
Add
S3StorageDriver(..., ex_allow_path_double_slashes=True)to preserve the request path before signing and sending it. The default remains unchanged, the existing global setting remains supported, and enabling the option does not affect another driver instance. Includes documentation and a changelog entry.Regression tests inspect the outgoing DELETE request for
/object,path//object, and//path///object, and verify per-driver isolation and global-setting compatibility. Before the fix, all three request-path assertions and the per-driver assertion fail.Status
Ready for review. Prepared with OpenAI Codex assistance.
Validation:
python -m pytest libcloud/test/storage/test_s3.py libcloud/test/common/test_base.py libcloud/test/test_connection.py -q— 89 passed, 1 skipped, 3 subtests passed.git diff --check— passed.Checklist