feat(storage): add create_signed_upload_urls batch helper - #1566
Open
OscarTheWhiteHatHacker wants to merge 1 commit into
Open
feat(storage): add create_signed_upload_urls batch helper#1566OscarTheWhiteHatHacker wants to merge 1 commit into
OscarTheWhiteHatHacker wants to merge 1 commit into
Conversation
Adds a batch convenience helper to the Storage client that signs upload URLs for multiple object paths at once, mirroring the existing create_signed_urls() download API. The Storage API does not expose a bulk endpoint for signed upload URLs, so each path is signed individually via create_signed_upload_url. Sync and async clients both get the new method; options apply to every path. Closes supabase#1559.
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.
Summary
Adds
create_signed_upload_urls(paths, options)to the Storage client, a batch convenience helper that signs upload URLs for multiple object paths at once — mirroring the existingcreate_signed_urls()download API.The Storage API does not expose a bulk endpoint for signed upload URLs, so each path is signed individually via the existing
create_signed_upload_url()(as proposed in the issue). This removes manual per-path iteration for workflows like multi-image uploads or drag-and-drop batches.Closes #1559.
What changed
_async/file_api.py: newasync create_signed_upload_urlssigning each path sequentially._sync/file_api.py: matching sync implementation (kept in parity with the async source used by the unasync generator).tests/test_client.py: offline unit tests (no infra needed) covering the sync + async batch methods and option forwarding. They verify each path is signed, results are returned in order, andx-upsertheaders are forwarded.Verification
pytest tests/test_client.py— 22 passed (3 new)mypy src/storage3 tests— no issuesruff checkandruff format --checkon changed files — cleancc @olirice @silentworks