aws-sdk-s3 1.234.0 → 1.236.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/client.rb +10 -3
- data/lib/aws-sdk-s3/directory_downloader.rb +6 -1
- data/lib/aws-sdk-s3/express_credentials.rb +4 -1
- data/lib/aws-sdk-s3/express_credentials_provider.rb +23 -12
- data/lib/aws-sdk-s3/multipart_upload_error.rb +1 -1
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +10 -2
- data/lib/aws-sdk-s3.rb +1 -1
- data/sig/client.rbs +1 -0
- data/sig/customizations/errors.rbs +17 -0
- data/sig/multipart_upload_error.rbs +9 -0
- data/sig/resource.rbs +1 -0
- data/sig/transfer_manager.rbs +31 -0
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 977da30326e0ec75cdd7a56efb408b900106b9dfbdd9ac0645375551dfecccaa
|
|
4
|
+
data.tar.gz: b829179ce40ee29a93b2b366b2607f2cfa6a1cfdb96580657b6238b685c95040
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a0ccbc0478fd7441a437ae2de8b93b9b3115e1df80c56ad0a17c9f9e11ab8da89e465287f0e55b5bff639b6070b58290aa01622cd82c15fa98b3dbb45ec9f54
|
|
7
|
+
data.tar.gz: ec282ef84b7c70f7f374af7611f2ef2ee016a809bc4a6d046a9e766f362fcd5a85725cec33c709041527ad93a888ff6b060f8be0bcaabf052a47c728e44b9361
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
Unreleased Changes
|
|
2
2
|
------------------
|
|
3
3
|
|
|
4
|
+
1.236.0 (2026-10-28)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
|
|
8
|
+
|
|
9
|
+
* Issue - Create and cache S3 Express sessions using the credentials of the requesting client.
|
|
10
|
+
|
|
11
|
+
1.235.0 (2026-10-20)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
|
|
15
|
+
|
|
16
|
+
* Feature - Add RBS signatures for `TransferManager`, `MultipartUploadError`, `Errors::NotFound` and `Errors::SlowDown`.
|
|
17
|
+
|
|
18
|
+
* Issue - Improve object key validation in `TransferManager#download_directory` on Windows.
|
|
19
|
+
|
|
4
20
|
1.234.0 (2026-10-19)
|
|
5
21
|
------------------
|
|
6
22
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.236.0
|
data/lib/aws-sdk-s3/client.rb
CHANGED
|
@@ -255,13 +255,20 @@ module Aws::S3
|
|
|
255
255
|
# the required types.
|
|
256
256
|
#
|
|
257
257
|
# @option options [Boolean] :correct_clock_skew (true)
|
|
258
|
-
# Used only in `standard` and `adaptive` retry modes. Specifies whether
|
|
259
|
-
# a clock skew correction and retry requests with skewed client
|
|
258
|
+
# Used only in `standard` and `adaptive` retry modes. Specifies whether
|
|
259
|
+
# to apply a clock skew correction and retry requests with skewed client
|
|
260
|
+
# clocks. Takes effect only when `disable_clock_skew_correction` is not set.
|
|
260
261
|
#
|
|
261
262
|
# @option options [String] :defaults_mode ("legacy")
|
|
262
263
|
# See {Aws::DefaultsModeConfiguration} for a list of the
|
|
263
264
|
# accepted modes and the configuration defaults that are included.
|
|
264
265
|
#
|
|
266
|
+
# @option options [Boolean] :disable_clock_skew_correction
|
|
267
|
+
# Used only in `standard` and `adaptive` retry modes. When `true`, the
|
|
268
|
+
# SDK does not apply a clock skew correction, does not update its stored
|
|
269
|
+
# skew from responses, and does not retry clock skew errors. Clock skew
|
|
270
|
+
# correction is enabled by default.
|
|
271
|
+
#
|
|
265
272
|
# @option options [Boolean] :disable_host_prefix_injection (false)
|
|
266
273
|
# When `true`, the SDK will not prepend the modeled host prefix to the endpoint.
|
|
267
274
|
#
|
|
@@ -24209,7 +24216,7 @@ module Aws::S3
|
|
|
24209
24216
|
tracer: tracer
|
|
24210
24217
|
)
|
|
24211
24218
|
context[:gem_name] = 'aws-sdk-s3'
|
|
24212
|
-
context[:gem_version] = '1.
|
|
24219
|
+
context[:gem_version] = '1.236.0'
|
|
24213
24220
|
Seahorse::Client::Request.new(handlers, context)
|
|
24214
24221
|
end
|
|
24215
24222
|
|
|
@@ -209,7 +209,12 @@ module Aws
|
|
|
209
209
|
end
|
|
210
210
|
|
|
211
211
|
def validate_key(key)
|
|
212
|
-
|
|
212
|
+
validation_key = key
|
|
213
|
+
if File::ALT_SEPARATOR
|
|
214
|
+
validation_key = key.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
segments = validation_key.split(File::SEPARATOR)
|
|
213
218
|
return unless segments.any? { |s| %w[. ..].include?(s) }
|
|
214
219
|
|
|
215
220
|
DirectoryDownloadError.new("invalid key '#{key}': contains '.' or '..' path segments")
|
|
@@ -14,6 +14,7 @@ module Aws
|
|
|
14
14
|
|
|
15
15
|
def initialize(options = {})
|
|
16
16
|
@client = options[:client]
|
|
17
|
+
@base_credentials = options[:base_credentials]
|
|
17
18
|
@create_session_params = {}
|
|
18
19
|
options.each_pair do |key, value|
|
|
19
20
|
if self.class.create_session_options.include?(key)
|
|
@@ -30,7 +31,9 @@ module Aws
|
|
|
30
31
|
private
|
|
31
32
|
|
|
32
33
|
def refresh
|
|
33
|
-
|
|
34
|
+
request = @client.build_request(:create_session, @create_session_params)
|
|
35
|
+
request.context[:sigv4_credentials] = @base_credentials if @base_credentials
|
|
36
|
+
c = request.send_request.credentials
|
|
34
37
|
@credentials = Credentials.new(
|
|
35
38
|
c.access_key_id,
|
|
36
39
|
c.secret_access_key,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
|
|
3
5
|
module Aws
|
|
4
6
|
module S3
|
|
5
7
|
# @api private
|
|
@@ -10,9 +12,12 @@ module Aws
|
|
|
10
12
|
# Returns Credentials class for S3 Express. Accepts CreateSession
|
|
11
13
|
# params as options. See {Client#create_session} for details.
|
|
12
14
|
class ExpressCredentialsProvider
|
|
15
|
+
CACHE_KEY_SECRET = SecureRandom.random_bytes(64)
|
|
16
|
+
private_constant :CACHE_KEY_SECRET
|
|
17
|
+
|
|
13
18
|
# @param [Hash] options
|
|
14
19
|
# @option options [Client] :client The S3 client used to create the
|
|
15
|
-
# session.
|
|
20
|
+
# session when one is not given to {#express_credentials_for}.
|
|
16
21
|
# @option options [String] :session_mode (see: {Client#create_session})
|
|
17
22
|
# @option options [Boolean] :caching (true) When true, credentials will
|
|
18
23
|
# be cached.
|
|
@@ -27,11 +32,12 @@ module Aws
|
|
|
27
32
|
@cache = Aws::S3.express_credentials_cache
|
|
28
33
|
end
|
|
29
34
|
|
|
30
|
-
def express_credentials_for(bucket)
|
|
35
|
+
def express_credentials_for(bucket, client = @client)
|
|
36
|
+
credentials = client.config.credentials&.credentials
|
|
31
37
|
if @caching
|
|
32
|
-
cached_credentials_for(bucket)
|
|
38
|
+
cached_credentials_for(bucket, client, credentials)
|
|
33
39
|
else
|
|
34
|
-
new_credentials_for(bucket)
|
|
40
|
+
new_credentials_for(bucket, client, credentials)
|
|
35
41
|
end
|
|
36
42
|
end
|
|
37
43
|
|
|
@@ -39,18 +45,23 @@ module Aws
|
|
|
39
45
|
|
|
40
46
|
private
|
|
41
47
|
|
|
42
|
-
def cached_credentials_for(bucket)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
def cached_credentials_for(bucket, client, credentials)
|
|
49
|
+
@cache[cache_key(bucket, credentials)] ||= new_credentials_for(bucket, client, credentials)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def cache_key(bucket, credentials)
|
|
53
|
+
identity = "#{credentials&.access_key_id}#{credentials&.secret_access_key}"
|
|
54
|
+
"#{OpenSSL::HMAC.hexdigest('SHA256', CACHE_KEY_SECRET, identity)}#{bucket}"
|
|
48
55
|
end
|
|
49
56
|
|
|
50
|
-
def new_credentials_for(bucket)
|
|
57
|
+
def new_credentials_for(bucket, client, credentials)
|
|
58
|
+
# Sign with this snapshot, but report the provider's UserAgent metrics.
|
|
59
|
+
credentials = credentials&.dup
|
|
60
|
+
credentials&.metrics = client.config.credentials.metrics
|
|
51
61
|
ExpressCredentials.new(
|
|
52
62
|
bucket: bucket,
|
|
53
|
-
client:
|
|
63
|
+
client: client,
|
|
64
|
+
base_credentials: credentials,
|
|
54
65
|
**@options
|
|
55
66
|
)
|
|
56
67
|
end
|
|
@@ -10,7 +10,7 @@ module Aws
|
|
|
10
10
|
super(message)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
# @return [Array<
|
|
13
|
+
# @return [Array<Exception>] The list of errors encountered when uploading or aborting the upload.
|
|
14
14
|
attr_reader :errors
|
|
15
15
|
end
|
|
16
16
|
end
|
|
@@ -35,8 +35,7 @@ for different buckets.
|
|
|
35
35
|
if context[:auth_scheme]['name'] == 'sigv4-s3express' &&
|
|
36
36
|
!context.config.disable_s3_express_session_auth
|
|
37
37
|
bucket = context.params[:bucket]
|
|
38
|
-
|
|
39
|
-
credentials = credentials_provider.express_credentials_for(bucket)
|
|
38
|
+
credentials = express_credentials_for(context, bucket)
|
|
40
39
|
context[:sigv4_credentials] = credentials # Sign will use this
|
|
41
40
|
end
|
|
42
41
|
|
|
@@ -45,6 +44,15 @@ for different buckets.
|
|
|
45
44
|
|
|
46
45
|
private
|
|
47
46
|
|
|
47
|
+
def express_credentials_for(context, bucket)
|
|
48
|
+
provider = context.config.express_credentials_provider
|
|
49
|
+
if provider.is_a?(ExpressCredentialsProvider)
|
|
50
|
+
provider.express_credentials_for(bucket, context.client)
|
|
51
|
+
else
|
|
52
|
+
provider.express_credentials_for(bucket)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
48
56
|
def with_metric(credentials, &block)
|
|
49
57
|
return block.call unless credentials
|
|
50
58
|
|
data/lib/aws-sdk-s3.rb
CHANGED
data/sig/client.rbs
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Aws
|
|
2
|
+
module S3
|
|
3
|
+
module Errors
|
|
4
|
+
# Not modeled in the API. Defined at runtime by Aws::Errors::DynamicErrors.
|
|
5
|
+
|
|
6
|
+
# Raised for a 404 response without an error body (e.g. HEAD requests).
|
|
7
|
+
# https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html
|
|
8
|
+
class NotFound < ServiceError
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Raised when S3 returns a 503 Slow Down response because the request rate is too high.
|
|
12
|
+
# https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList
|
|
13
|
+
class SlowDown < ServiceError
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/sig/resource.rbs
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Aws
|
|
2
|
+
module S3
|
|
3
|
+
class TransferManager
|
|
4
|
+
type download_result = { completed_downloads: Integer, failed_downloads: Integer, ?errors: Array[StandardError] }
|
|
5
|
+
type upload_result = { completed_uploads: Integer, failed_uploads: Integer, ?errors: Array[StandardError] }
|
|
6
|
+
type upload_response = Client::_PutObjectResponseSuccess | Client::_CompleteMultipartUploadResponseSuccess
|
|
7
|
+
|
|
8
|
+
def initialize: (?client: Client, ?executor: untyped, ?logger: untyped) -> void
|
|
9
|
+
|
|
10
|
+
attr_reader client: Client
|
|
11
|
+
attr_reader executor: untyped
|
|
12
|
+
attr_reader logger: untyped
|
|
13
|
+
|
|
14
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/TransferManager.html#download_directory-instance_method
|
|
15
|
+
def download_directory: (String destination, bucket: String, **untyped options) -> download_result
|
|
16
|
+
|
|
17
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/TransferManager.html#download_file-instance_method
|
|
18
|
+
def download_file: (untyped destination, bucket: String, key: String, **untyped options) -> true
|
|
19
|
+
|
|
20
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/TransferManager.html#upload_directory-instance_method
|
|
21
|
+
def upload_directory: (String | Pathname source, bucket: String, **untyped options) -> upload_result
|
|
22
|
+
|
|
23
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/TransferManager.html#upload_file-instance_method
|
|
24
|
+
def upload_file: (untyped source, bucket: String, key: String, **untyped options)
|
|
25
|
+
?{ (upload_response response) -> void } -> true
|
|
26
|
+
|
|
27
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/TransferManager.html#upload_stream-instance_method
|
|
28
|
+
def upload_stream: (bucket: String, key: String, **untyped options) { (IO write_stream) -> void } -> true
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aws-sdk-s3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.236.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Amazon Web Services
|
|
@@ -46,7 +46,7 @@ dependencies:
|
|
|
46
46
|
version: '3'
|
|
47
47
|
- - ">="
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: 3.
|
|
49
|
+
version: 3.262.0
|
|
50
50
|
type: :runtime
|
|
51
51
|
prerelease: false
|
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -56,7 +56,7 @@ dependencies:
|
|
|
56
56
|
version: '3'
|
|
57
57
|
- - ">="
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: 3.
|
|
59
|
+
version: 3.262.0
|
|
60
60
|
description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
|
|
61
61
|
This gem is part of the AWS SDK for Ruby.
|
|
62
62
|
email:
|
|
@@ -208,10 +208,12 @@ files:
|
|
|
208
208
|
- sig/bucket_website.rbs
|
|
209
209
|
- sig/client.rbs
|
|
210
210
|
- sig/customizations/bucket.rbs
|
|
211
|
+
- sig/customizations/errors.rbs
|
|
211
212
|
- sig/customizations/object.rbs
|
|
212
213
|
- sig/customizations/object_summary.rbs
|
|
213
214
|
- sig/errors.rbs
|
|
214
215
|
- sig/multipart_upload.rbs
|
|
216
|
+
- sig/multipart_upload_error.rbs
|
|
215
217
|
- sig/multipart_upload_part.rbs
|
|
216
218
|
- sig/object.rbs
|
|
217
219
|
- sig/object_acl.rbs
|
|
@@ -219,6 +221,7 @@ files:
|
|
|
219
221
|
- sig/object_version.rbs
|
|
220
222
|
- sig/params.rbs
|
|
221
223
|
- sig/resource.rbs
|
|
224
|
+
- sig/transfer_manager.rbs
|
|
222
225
|
- sig/types.rbs
|
|
223
226
|
- sig/waiters.rbs
|
|
224
227
|
homepage: https://github.com/aws/aws-sdk-ruby
|