aws-sdk-s3 1.61.2 → 1.62.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 +5 -5
- data/lib/aws-sdk-s3.rb +1 -1
- data/lib/aws-sdk-s3/bucket.rb +2 -2
- data/lib/aws-sdk-s3/client.rb +3 -3
- data/lib/aws-sdk-s3/encryption/client.rb +4 -4
- data/lib/aws-sdk-s3/encryption/materials.rb +6 -6
- data/lib/aws-sdk-s3/file_downloader.rb +8 -8
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +1 -1
- data/lib/aws-sdk-s3/object.rb +2 -2
- data/lib/aws-sdk-s3/object_summary.rb +2 -2
- data/lib/aws-sdk-s3/plugins/accelerate.rb +4 -4
- data/lib/aws-sdk-s3/plugins/bucket_arn.rb +21 -22
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +1 -1
- data/lib/aws-sdk-s3/plugins/md5s.rb +3 -1
- data/lib/aws-sdk-s3/presigned_post.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2215607f661aa4176b322589d7abe5e707263c6b9465cc8f57c48d517f90ff4d
|
4
|
+
data.tar.gz: c2b1125ca62d14989ba39cb0b105032eee2a1166aa08f325ee4265f62d41018d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a198d8fbe9a49fd39aeefebf2f361f375ee7c079f7500e336fecb3d9cfbb68e4c2e18c6a379abeb9b0618179f5a476d482ec81ef9dd51c8a57ce1e6c85f0984f
|
7
|
+
data.tar.gz: 7634f23c03f1f3dc211275ae0166dbda1d46c31dcfb6eb45b327d2455c0d53d0cdc805d5f9ad52538c462aaef369019793d04c091f16582e33ade22db7a00631
|
data/lib/aws-sdk-s3.rb
CHANGED
data/lib/aws-sdk-s3/bucket.rb
CHANGED
@@ -829,8 +829,8 @@ module Aws::S3
|
|
829
829
|
|
830
830
|
def yield_waiter_and_warn(waiter, &block)
|
831
831
|
if !@waiter_block_warned
|
832
|
-
msg = "pass options to configure the waiter; "
|
833
|
-
|
832
|
+
msg = "pass options to configure the waiter; "\
|
833
|
+
"yielding the waiter is deprecated"
|
834
834
|
warn(msg)
|
835
835
|
@waiter_block_warned = true
|
836
836
|
end
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -11239,8 +11239,8 @@ module Aws::S3
|
|
11239
11239
|
when nil then EventStreams::SelectObjectContentEventStream.new
|
11240
11240
|
else
|
11241
11241
|
msg = "expected :event_stream_handler to be a block or "\
|
11242
|
-
|
11243
|
-
|
11242
|
+
"instance of Aws::S3::EventStreams::SelectObjectContentEventStream"\
|
11243
|
+
", got `#{handler.inspect}` instead"
|
11244
11244
|
raise ArgumentError, msg
|
11245
11245
|
end
|
11246
11246
|
|
@@ -11789,7 +11789,7 @@ module Aws::S3
|
|
11789
11789
|
params: params,
|
11790
11790
|
config: config)
|
11791
11791
|
context[:gem_name] = 'aws-sdk-s3'
|
11792
|
-
context[:gem_version] = '1.
|
11792
|
+
context[:gem_version] = '1.62.0'
|
11793
11793
|
Seahorse::Client::Request.new(handlers, context)
|
11794
11794
|
end
|
11795
11795
|
|
@@ -331,7 +331,7 @@ module Aws
|
|
331
331
|
elsif options[:encryption_key]
|
332
332
|
DefaultKeyProvider.new(options)
|
333
333
|
else
|
334
|
-
msg =
|
334
|
+
msg = 'you must pass a :kms_key_id, :key_provider, or :encryption_key'
|
335
335
|
raise ArgumentError, msg
|
336
336
|
end
|
337
337
|
end
|
@@ -351,8 +351,8 @@ module Aws
|
|
351
351
|
if [:metadata, :instruction_file].include?(location)
|
352
352
|
location
|
353
353
|
else
|
354
|
-
msg =
|
355
|
-
|
354
|
+
msg = ':envelope_location must be :metadata or :instruction_file '\
|
355
|
+
"got #{location.inspect}"
|
356
356
|
raise ArgumentError, msg
|
357
357
|
end
|
358
358
|
end
|
@@ -362,7 +362,7 @@ module Aws
|
|
362
362
|
if String === suffix
|
363
363
|
suffix
|
364
364
|
else
|
365
|
-
msg =
|
365
|
+
msg = ':instruction_file_suffix must be a String'
|
366
366
|
raise ArgumentError, msg
|
367
367
|
end
|
368
368
|
end
|
@@ -32,14 +32,14 @@ module Aws
|
|
32
32
|
if [32, 24, 16].include?(key.bytesize)
|
33
33
|
key
|
34
34
|
else
|
35
|
-
msg =
|
36
|
-
|
35
|
+
msg = 'invalid key, symmetric key required to be 16, 24, or '\
|
36
|
+
'32 bytes in length, saw length ' + key.bytesize.to_s
|
37
37
|
raise ArgumentError, msg
|
38
38
|
end
|
39
39
|
else
|
40
|
-
msg =
|
41
|
-
|
42
|
-
|
40
|
+
msg = 'invalid encryption key, expected an OpenSSL::PKey::RSA key '\
|
41
|
+
'(for asymmetric encryption) or a String (for symmetric '\
|
42
|
+
'encryption).'
|
43
43
|
raise ArgumentError, msg
|
44
44
|
end
|
45
45
|
end
|
@@ -48,7 +48,7 @@ module Aws
|
|
48
48
|
Json.load(description)
|
49
49
|
description
|
50
50
|
rescue Json::ParseError, EncodingError
|
51
|
-
msg =
|
51
|
+
msg = 'expected description to be a valid JSON document string'
|
52
52
|
raise ArgumentError, msg
|
53
53
|
end
|
54
54
|
|
@@ -21,7 +21,7 @@ module Aws
|
|
21
21
|
|
22
22
|
def download(destination, options = {})
|
23
23
|
@path = destination
|
24
|
-
@mode = options[:mode] ||
|
24
|
+
@mode = options[:mode] || 'auto'
|
25
25
|
@thread_count = options[:thread_count] || THREAD_COUNT
|
26
26
|
@chunk_size = options[:chunk_size]
|
27
27
|
@params = {
|
@@ -31,19 +31,19 @@ module Aws
|
|
31
31
|
@params[:version_id] = options[:version_id] if options[:version_id]
|
32
32
|
|
33
33
|
case @mode
|
34
|
-
when
|
35
|
-
when
|
36
|
-
when
|
34
|
+
when 'auto' then multipart_download
|
35
|
+
when 'single_request' then single_request
|
36
|
+
when 'get_range'
|
37
37
|
if @chunk_size
|
38
38
|
resp = @client.head_object(@params)
|
39
39
|
multithreaded_get_by_ranges(construct_chunks(resp.content_length))
|
40
40
|
else
|
41
|
-
msg =
|
41
|
+
msg = 'In :get_range mode, :chunk_size must be provided'
|
42
42
|
raise ArgumentError, msg
|
43
43
|
end
|
44
44
|
else
|
45
45
|
msg = "Invalid mode #{@mode} provided, "\
|
46
|
-
|
46
|
+
'mode should be :single_request, :get_range or :auto'
|
47
47
|
raise ArgumentError, msg
|
48
48
|
end
|
49
49
|
end
|
@@ -125,8 +125,8 @@ module Aws
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def write(resp)
|
128
|
-
range, _ = resp.content_range.split(
|
129
|
-
head, _ = range.split(
|
128
|
+
range, _ = resp.content_range.split(' ').last.split('/')
|
129
|
+
head, _ = range.split('-').map {|s| s.to_i}
|
130
130
|
IO.write(@path, resp.body.read, head)
|
131
131
|
end
|
132
132
|
|
@@ -113,7 +113,7 @@ module Aws
|
|
113
113
|
|
114
114
|
def read_to_part_body(read_pipe)
|
115
115
|
return if read_pipe.closed?
|
116
|
-
temp_io = @tempfile ? Tempfile.new(TEMPFILE_PREIX) : StringIO.new
|
116
|
+
temp_io = @tempfile ? Tempfile.new(TEMPFILE_PREIX) : StringIO.new(String.new)
|
117
117
|
temp_io.binmode
|
118
118
|
bytes_copied = IO.copy_stream(read_pipe, temp_io, @part_size)
|
119
119
|
temp_io.rewind
|
data/lib/aws-sdk-s3/object.rb
CHANGED
@@ -1330,8 +1330,8 @@ module Aws::S3
|
|
1330
1330
|
|
1331
1331
|
def yield_waiter_and_warn(waiter, &block)
|
1332
1332
|
if !@waiter_block_warned
|
1333
|
-
msg = "pass options to configure the waiter; "
|
1334
|
-
|
1333
|
+
msg = "pass options to configure the waiter; "\
|
1334
|
+
"yielding the waiter is deprecated"
|
1335
1335
|
warn(msg)
|
1336
1336
|
@waiter_block_warned = true
|
1337
1337
|
end
|
@@ -1090,8 +1090,8 @@ module Aws::S3
|
|
1090
1090
|
|
1091
1091
|
def yield_waiter_and_warn(waiter, &block)
|
1092
1092
|
if !@waiter_block_warned
|
1093
|
-
msg = "pass options to configure the waiter; "
|
1094
|
-
|
1093
|
+
msg = "pass options to configure the waiter; "\
|
1094
|
+
"yielding the waiter is deprecated"
|
1095
1095
|
warn(msg)
|
1096
1096
|
@waiter_block_warned = true
|
1097
1097
|
end
|
@@ -78,13 +78,13 @@ each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3
|
|
78
78
|
|
79
79
|
def validate_bucket_name!(bucket_name)
|
80
80
|
unless BucketDns.dns_compatible?(bucket_name, _ssl = true)
|
81
|
-
msg =
|
82
|
-
|
81
|
+
msg = 'unable to use `accelerate: true` on buckets with '\
|
82
|
+
'non-DNS compatible names'
|
83
83
|
raise ArgumentError, msg
|
84
84
|
end
|
85
85
|
if bucket_name.include?('.')
|
86
|
-
msg =
|
87
|
-
|
86
|
+
msg = 'unable to use `accelerate: true` on buckets with dots'\
|
87
|
+
"in their name: #{bucket_name.inspect}"
|
88
88
|
raise ArgumentError, msg
|
89
89
|
end
|
90
90
|
end
|
@@ -66,19 +66,19 @@ the S3 ARN.
|
|
66
66
|
def validate_config!(config)
|
67
67
|
unless config.regional_endpoint
|
68
68
|
raise ArgumentError,
|
69
|
-
|
69
|
+
'Cannot provide both an accesspoint ARN and :endpoint.'
|
70
70
|
end
|
71
71
|
|
72
72
|
if config.use_accelerate_endpoint
|
73
73
|
raise ArgumentError,
|
74
|
-
|
75
|
-
|
74
|
+
'Cannot provide both an accesspoint ARN and setting '\
|
75
|
+
':use_accelerate_endpoint to true.'
|
76
76
|
end
|
77
77
|
|
78
78
|
if config.force_path_style
|
79
79
|
raise ArgumentError,
|
80
|
-
|
81
|
-
|
80
|
+
'Cannot provide both an accesspoint ARN and setting '\
|
81
|
+
':force_path_style to true.'
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
@@ -96,7 +96,7 @@ the S3 ARN.
|
|
96
96
|
[bucket_name, region, arn]
|
97
97
|
else
|
98
98
|
raise ArgumentError,
|
99
|
-
|
99
|
+
'Only accesspoint type ARNs are currently supported.'
|
100
100
|
end
|
101
101
|
else
|
102
102
|
[bucket_name, region]
|
@@ -109,7 +109,7 @@ the S3 ARN.
|
|
109
109
|
url.host = accesspoint_arn_host(arn, dualstack)
|
110
110
|
else
|
111
111
|
raise ArgumentError,
|
112
|
-
|
112
|
+
'Only accesspoint type ARNs are currently supported.'
|
113
113
|
end
|
114
114
|
url.path = url_path(url.path, arn)
|
115
115
|
url
|
@@ -119,12 +119,11 @@ the S3 ARN.
|
|
119
119
|
|
120
120
|
def accesspoint_arn_host(arn, dualstack)
|
121
121
|
_resource_type, resource_name = parse_resource(arn.resource)
|
122
|
-
accesspoint = "#{resource_name}-#{arn.account_id}"
|
123
|
-
accesspoint << '.s3-accesspoint'
|
124
|
-
accesspoint << '.dualstack' if dualstack
|
125
122
|
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(arn.region)
|
126
|
-
|
127
|
-
accesspoint
|
123
|
+
"#{resource_name}-#{arn.account_id}"\
|
124
|
+
'.s3-accesspoint'\
|
125
|
+
"#{'.dualstack' if dualstack}"\
|
126
|
+
".#{arn.region}.#{sfx}"
|
128
127
|
end
|
129
128
|
|
130
129
|
def parse_resource(str)
|
@@ -146,9 +145,9 @@ the S3 ARN.
|
|
146
145
|
# Raise if provided value is not true or false
|
147
146
|
if value != 'true' && value != 'false'
|
148
147
|
raise ArgumentError,
|
149
|
-
|
150
|
-
|
151
|
-
|
148
|
+
'Must provide either `true` or `false` for '\
|
149
|
+
's3_use_arn_region profile option or for '\
|
150
|
+
'ENV[\'AWS_S3_USE_ARN_REGION\']'
|
152
151
|
end
|
153
152
|
|
154
153
|
value == 'true'
|
@@ -170,29 +169,29 @@ the S3 ARN.
|
|
170
169
|
|
171
170
|
if arn.region.empty? || arn.account_id.empty?
|
172
171
|
raise ArgumentError,
|
173
|
-
|
174
|
-
|
172
|
+
'S3 Access Point ARNs must contain both a valid region '\
|
173
|
+
' and a valid account id.'
|
175
174
|
end
|
176
175
|
|
177
176
|
if resource_name.include?(':') || resource_name.include?('/')
|
178
177
|
raise ArgumentError,
|
179
|
-
|
178
|
+
'ARN resource id must be a single value.'
|
180
179
|
end
|
181
180
|
|
182
181
|
unless Plugins::BucketDns.valid_subdomain?(
|
183
182
|
"#{resource_name}-#{arn.account_id}"
|
184
183
|
)
|
185
184
|
raise ArgumentError,
|
186
|
-
|
187
|
-
|
185
|
+
"#{resource_name}-#{arn.account_id} is not a "\
|
186
|
+
'valid subdomain.'
|
188
187
|
end
|
189
188
|
end
|
190
189
|
|
191
190
|
def validate_region!(arn, region, s3_use_arn_region)
|
192
191
|
if region.include?('fips')
|
193
192
|
raise ArgumentError,
|
194
|
-
|
195
|
-
|
193
|
+
'FIPS client regions are currently not supported with '\
|
194
|
+
'accesspoint ARNs.'
|
196
195
|
end
|
197
196
|
|
198
197
|
if s3_use_arn_region &&
|
@@ -44,7 +44,7 @@ region. Defaults to `legacy` mode using global endpoint.
|
|
44
44
|
mode = ENV['AWS_S3_US_EAST_1_REGIONAL_ENDPOINT'] ||
|
45
45
|
Aws.shared_config.s3_us_east_1_regional_endpoint(profile: cfg.profile) ||
|
46
46
|
'legacy'
|
47
|
-
mode.downcase
|
47
|
+
mode = mode.downcase
|
48
48
|
unless %w(legacy regional).include?(mode)
|
49
49
|
raise ArgumentError, "expected :s3_us_east_1_regional_endpoint or"\
|
50
50
|
" ENV['AWS_S3_US_EAST_1_REGIONAL_ENDPOINT'] to be `legacy` or"\
|
@@ -234,7 +234,7 @@ module Aws
|
|
234
234
|
# as hidden input fields.
|
235
235
|
def fields
|
236
236
|
check_required_values!
|
237
|
-
datetime = Time.now.utc.strftime(
|
237
|
+
datetime = Time.now.utc.strftime('%Y%m%dT%H%M%SZ')
|
238
238
|
fields = @fields.dup
|
239
239
|
fields.update('policy' => policy(datetime))
|
240
240
|
fields.update(signature_fields(datetime))
|
@@ -571,8 +571,8 @@ module Aws
|
|
571
571
|
|
572
572
|
def check_required_values!
|
573
573
|
unless @key_set
|
574
|
-
msg =
|
575
|
-
|
574
|
+
msg = 'key required; you must provide a key via :key, '\
|
575
|
+
":key_starts_with, or :allow_any => ['key']"
|
576
576
|
raise msg
|
577
577
|
end
|
578
578
|
end
|
@@ -617,7 +617,7 @@ module Aws
|
|
617
617
|
|
618
618
|
def signature(datetime, string_to_sign)
|
619
619
|
k_secret = @credentials.secret_access_key
|
620
|
-
k_date = hmac(
|
620
|
+
k_date = hmac('AWS4' + k_secret, datetime[0,8])
|
621
621
|
k_region = hmac(k_date, @bucket_region)
|
622
622
|
k_service = hmac(k_region, 's3')
|
623
623
|
k_credentials = hmac(k_service, 'aws4_request')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.62.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
164
|
rubyforge_project:
|
165
|
-
rubygems_version: 2.
|
165
|
+
rubygems_version: 2.7.6.2
|
166
166
|
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: AWS SDK for Ruby - Amazon S3
|