Skip to content

S3: preserve repeated object path slashes with a per-driver option - #2189

Open
Shubham-Padkonde wants to merge 1 commit into
apache:trunkfrom
Shubham-Padkonde:fix/s3-preserve-object-slashes
Open

Shubham-Padkonde wants to merge 1 commit into
apache:trunkfrom
Shubham-Padkonde:fix/s3-preserve-object-slashes

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

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:

  • Linux / Python 3.14: 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.
  • Black, isort, flake8 on both changed Python files; configured Pylint error check on the production file; git diff --check — passed.
  • An initial Windows / Python 3.12 run had two existing download-test temporary-file failures; both pass on Linux. Existing datetime deprecation warnings remain.
  • No live AWS account testing or full provider suite run. HTTP responses are mocked; request construction and signing use the real driver.

Checklist

  • Code linting
  • Documentation
  • Tests
  • ICLA (no signature claimed; this is a small driver option and regression fix)

Addresses apache#1654 without changing the global URL normalization default.

Generated-by: OpenAI Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant