Repository navigation
refactor(store)!: remove ObjectStore.signed_post - #96
Merged
Merged
Conversation
issue_upload_policy is the upload policy API: typed, with the uploader's path
and file field names, and a lifetime the store either honours or refuses.
signed_post returned boto3's raw {url, fields} and behaved differently per
store (S3 kept the prefix as given until recently; GCS returned None without a
signer and silently clamped the expiry). Nothing calls it now, so it goes:
from the base class, the S3 and GCS stores and the routing store.
S3ObjectStore._post_policy and GCSObjectStore._post_policy take a required
max_bytes, since issue_upload_policy always passes one. S3's upload-policy
coverage is in test_object_transfer_grants; GCS keeps its bucket-root case as an
issue_upload_policy test.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
Breaking: removes
ObjectStore.signed_postfrom the base class and fromS3ObjectStore,GCSObjectStoreand the routing store.issue_upload_policyis the upload-policy API. It returns a typedUploadPolicywhoseHttpPostPolicyGrantnames the uploader's path and file fields. Its lifetime is one the store either honours or refuses.signed_postreturned boto3's raw{url, fields}dict and behaved differently per store:Nonewithout a signer and silently clamped the expiry;None.Nothing in this repo calls it any more, and neither do the downstream stores we know of.
Migrating:
issue_upload_policyraisesGrantUnavailableErrorwheresigned_postreturnedNone, andNotImplementedErroron stores without grants. A caller that only needs one object at a known URL can useissue_write_grant(an HTTPS PUT signed for the object's content type).S3ObjectStore._post_policyandGCSObjectStore._post_policynow take a requiredmax_bytes, sinceissue_upload_policyalways passes one.Testing
tst/unit/store/s3_signed_post_test.pyis deleted. Its upload-policy cases are covered bytest_object_transfer_grants.py, which checks the exactgenerate_presigned_postcall for prefixes with and without a trailing slash. Itssigned_post-only cases (no size bound,Nonefrom stores that can't sign) have no successor.signed_posttest's bucket-root case is now anissue_upload_policytest.signed_post.tst/unit6066 passed (13 skipped); protocol 330 passed.Labelled
bump-version.🤖 Generated with Claude Code
The PR appears safe to merge as the intended breaking API change.
Summary
The PR removes
signed_postfrom object stores and routes prefix uploads through the typedissue_upload_policyAPI. S3 and GCS policies now require a per-object size limit.Reviews (1) · Last reviewed commit: "refactor(store)!: remove ObjectStore.sig..." · Reviewed by Greptile