Skip to content

fix: do not defer signature for presigned PUTs (#116 regression)#117

Merged
ServerSideHannes merged 5 commits into
mainfrom
fix/presigned-put-deferred-sig
Jul 8, 2026
Merged

fix: do not defer signature for presigned PUTs (#116 regression)#117
ServerSideHannes merged 5 commits into
mainfrom
fix/presigned-put-deferred-sig

Conversation

@ServerSideHannes

Copy link
Copy Markdown
Owner

Summary

Problem

Scylla Manager uploads SSTs with presigned PUT URLs, not Authorization header auth. #116 deferred signature whenever x-amz-content-sha256 was absent on large PUTs. That incorrectly routed presigned requests through prepare_header_auth → deferred verify → 403 Forbidden.

Fix

  • Skip body preload and deferred signature when query contains X-Amz-Signature (or legacy Signature)
  • Presigned large PUTs verify immediately and stream without double-buffering

Test plan

  • uv run pytest tests/unit/test_request_handler_body.py tests/unit/test_sigv4.py -q — 42 passed
  • Deploy hotfix 2026.7.13 after merge; confirm Scylla backup PUTs return 200

Made with Cursor

ServerSideHannes and others added 5 commits July 8, 2026 17:08
Scylla Manager uploads SSTs via presigned URLs (X-Amz-Signature in query).
PR #116 treated missing x-amz-content-sha256 as deferred header-auth, which
routed presigned PUTs through prepare_header_auth and failed with 403.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Pass query dict to _needs_body_for_signature in test_routing.py and add
presigned coverage. Ruff-format request_handler.py for format check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Full-stack integration tests via generate_presigned_url (s3v4, Scylla shape)
and hand-crafted V2 URLs. Covers small/large PUT roundtrips and bad-signature
403 for both query-string auth styles.

Co-authored-by: Cursor <cursoragent@cursor.com>
Heavy copy e2e tests now use isolated throwaway MinIO containers instead of
filling the shared compose instance. Concurrent passthrough flood uses the 96MB
source (pipeline/memory test, not 1280MB scale). Give compose MinIO a 4GB tmpfs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ServerSideHannes ServerSideHannes merged commit a00e00a into main Jul 8, 2026
10 checks passed
@ServerSideHannes ServerSideHannes deleted the fix/presigned-put-deferred-sig branch July 8, 2026 16:10
ServerSideHannes added a commit that referenced this pull request Jul 8, 2026
#117 added a 4g tmpfs limit on compose MinIO for integration shards, but
OOM tests upload 5GB+ in a single case (20×256MB PUTs). Use a compose
override for make test-oom so MinIO falls back to disk-backed storage.

Co-authored-by: Cursor <cursoragent@cursor.com>
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