Skip to content

Commit 00aee8d

Browse files
committed
fix(stream_io): Default to signature version 4 for most S3 endpoints
1 parent 915e2ec commit 00aee8d

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
[2.9.3] - 2025-05-09
9+
10+
### Changed
11+
12+
- `stream_io.open_stream()` now defaults to authenticating with signature
13+
version 4 rather than signature version 2 when no `s3_signature_version`
14+
is specified for reads from most object storage endpoints
15+
816
[2.9.2] - 2025-02-20
917

1018
### Fixed
@@ -416,6 +424,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
416424
- `get_gpu_name`
417425
- `no_init_or_tensor`
418426

427+
[2.9.3]: https://github.com/coreweave/tensorizer/compare/v2.9.2...v2.9.3
419428
[2.9.2]: https://github.com/coreweave/tensorizer/compare/v2.9.1...v2.9.2
420429
[2.9.1]: https://github.com/coreweave/tensorizer/compare/v2.9.0...v2.9.1
421430
[2.9.0]: https://github.com/coreweave/tensorizer/compare/v2.8.1...v2.9.0

tensorizer/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.9.2"
1+
__version__ = "2.9.3"

tensorizer/stream_io.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,9 @@ def _s3_download_url(
978978
s3_signature_version: Optional[str] = None,
979979
) -> str:
980980
bucket, key = _parse_s3_uri(path_uri)
981-
# v2 signature is important to easily align the presigned URL expiry
982-
# times. This allows multiple clients to generate the exact same
981+
# v2 signature is important with accel-object
982+
# to easily align the presigned URL expiry times.
983+
# This allows multiple clients to generate the exact same
983984
# presigned URL, and get hits on a HTTP caching proxy.
984985
#
985986
# why v2 signature?
@@ -989,7 +990,8 @@ def _s3_download_url(
989990
# See upstream bug https://github.com/boto/botocore/issues/2230
990991
#
991992
if not s3_signature_version:
992-
s3_signature_version = "s3"
993+
is_accel: bool = "accel-object" in s3_endpoint.lower().split(".")
994+
s3_signature_version = "s3" if is_accel else "v4"
993995
client = _new_s3_client(
994996
s3_access_key_id,
995997
s3_secret_access_key,

0 commit comments

Comments
 (0)