Sync with InsForge-sdk-js v1.5.0
FE
3mo ago+139+139+012345678901234567890123456789-22-22-01234567890123456789
Ports the storage changes from InsForge-sdk-js v1.5.0 (diff v1.4.5..v1.5.0), paired with the backend change in InsForge/InsForge#1760.
Ported
upload_object(bucket, key, data)— now documented with standard object-storage PUT semantics: uploading to an existing key replaces the object in place (previously the server silently auto-renamed, e.g.photo.png→photo (1).png). Signature unchanged; this is a runtime behavior change driven by the backend.upload_object_auto(bucket, data=..., filename=...)— the backend no longer mints keys, so the unique, collision-free key is now generated client-side (<sanitized-base>-<timestamp-ms>-<random6><ext>, base capped at 32 chars,filefallback for an empty base — same algorithm as the JSgenerateObjectKey) and the upload is routed through the standardupload_objectPUT path instead of the oldPOST /objectsauto-name route. Repeated uploads of the same file never overwrite each other. Signature unchanged.- Tests — updated
test_upload_auto_and_strategy_endpointsfor the new PUT route, and added tests mirroring the new JS coverage: client-side key minting via PUT, distinct keys for repeated uploads of the same filename, and key-generation edge cases (sanitization, 32-char truncation, leading-dot filenames, empty-base fallback). - Version — bumped
pyproject.tomlto0.2.0(behavior change, pre-1.0). No changelog file exists in this repo, so none was updated.
Skipped
- JS test-harness scaffolding, CI workflow tweaks,
package.json/package-lock.jsonversion plumbing, andSDK-REFERENCE.md(JS-specific; the Python equivalent is the docstring onupload_object, and this repo's README does not documentupload_object_auto). - No
upsert/autoKeyflags existed in the Python SDK, so nothing to remove there.
Notes
- Requires an InsForge backend that includes the standard-PUT storage change (InsForge/InsForge#1760). Do not run against a pre-change backend.
Test results
pytest on Python 3.12: 88 passed, 15 skipped (skips are live-backend integration tests).
🤖 Generated with Claude Code
Summary by cubic
Syncs the Python SDK’s storage behavior with InsForge-sdk-js v1.5.0, adopting standard PUT semantics and client-side auto-key generation. This removes server auto-renaming and ensures collision-free uploads.
-
New Features
upload_object: PUT to an existing key replaces the object in place.upload_object_auto: generates a sanitized unique key client-side (<base>-<timestamp>-<random><ext>) and uploads via PUT; repeated uploads never overwrite.- Tests updated for PUT route and key-generation edge cases.
-
Migration
- Requires backend with the standard-PUT update (InsForge/InsForge#1760).
- Bumps
insforgeto0.2.0.