feat(unstable): Deno.S3Client and Deno.s3#35180
Draft
bartlomieju wants to merge 1 commit into
Draft
Conversation
Adds a built-in client for S3-compatible object storage behind --unstable-s3, implemented as a JS-only lazy loaded extension (ext/s3) on top of fetch and WebCrypto (AWS Signature Version 4).
Contributor
|
This feels like the runtime doing too much, which I think Bun gets wrong 😕 |
Contributor
|
Please do not rely on third party closed source services. AWS S3 may appear to be a stable interface, but it is being updated day by day. There have been breaking changes in the past.
Bun's S3 API is already abandoned due to its difficulties of testing. I predict that this API will become unusable in three years while it may seem convenient now. |
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.
Adds a built-in client for S3-compatible object storage (AWS S3, MinIO,
Cloudflare R2, Backblaze B2, etc.) behind
--unstable-s3, so objects canbe read, written, listed and presigned without pulling in a third-party
SDK:
It is implemented as a JS-only lazy loaded extension (ext/s3, no new ops)
on top of
fetchand WebCrypto: requests are signed with AWS SignatureVersion 4 (header auth for requests, query auth for presigned URLs), and
streaming writes go through multipart uploads. Configuration falls back to
the usual
S3_*/AWS_*environment variables, and a defaultenv-configured client is exposed as
Deno.s3. Network access requires--allow-net; environment fallbacks only require--allow-envwhenexplicit options are not provided.
Verified against a mock S3 server that re-computes both signature flavors
server-side, covering round-trips (text/JSON/binary/Blob/stream), keys
needing URI escaping, ranged reads via
slice(), a 12 MiB multipartupload, ListObjectsV2 paging, presigned GET/PUT consumed by plain
fetch,and
s3://bucket/keypaths.