aws-sdk-s3 1.151.0 → 1.154.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/bucket.rb +10 -10
- data/lib/aws-sdk-s3/bucket_acl.rb +3 -3
- data/lib/aws-sdk-s3/bucket_cors.rb +4 -4
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +4 -4
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +4 -4
- data/lib/aws-sdk-s3/bucket_logging.rb +3 -3
- data/lib/aws-sdk-s3/bucket_notification.rb +3 -3
- data/lib/aws-sdk-s3/bucket_policy.rb +4 -4
- data/lib/aws-sdk-s3/bucket_request_payment.rb +3 -3
- data/lib/aws-sdk-s3/bucket_tagging.rb +4 -4
- data/lib/aws-sdk-s3/bucket_versioning.rb +5 -5
- data/lib/aws-sdk-s3/bucket_website.rb +4 -4
- data/lib/aws-sdk-s3/client.rb +66 -63
- data/lib/aws-sdk-s3/client_api.rb +2 -2
- data/lib/aws-sdk-s3/customizations/bucket.rb +1 -1
- data/lib/aws-sdk-s3/customizations/object.rb +5 -5
- data/lib/aws-sdk-s3/encryption/client.rb +2 -2
- data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +2 -2
- data/lib/aws-sdk-s3/encryptionV2/client.rb +2 -2
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +2 -2
- data/lib/aws-sdk-s3/endpoint_parameters.rb +8 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +1 -0
- data/lib/aws-sdk-s3/endpoints.rb +100 -1
- data/lib/aws-sdk-s3/file_downloader.rb +1 -1
- data/lib/aws-sdk-s3/file_uploader.rb +1 -1
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +1 -1
- data/lib/aws-sdk-s3/multipart_upload.rb +4 -4
- data/lib/aws-sdk-s3/multipart_upload_part.rb +3 -3
- data/lib/aws-sdk-s3/object.rb +12 -12
- data/lib/aws-sdk-s3/object_acl.rb +3 -3
- data/lib/aws-sdk-s3/object_copier.rb +1 -1
- data/lib/aws-sdk-s3/object_summary.rb +10 -10
- data/lib/aws-sdk-s3/object_version.rb +5 -5
- data/lib/aws-sdk-s3/plugins/access_grants.rb +7 -1
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +7 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +53 -16
- data/lib/aws-sdk-s3/resource.rb +2 -2
- data/lib/aws-sdk-s3.rb +1 -1
- metadata +4 -4
@@ -37,7 +37,7 @@ module Aws
|
|
37
37
|
# objects smaller than the multipart threshold.
|
38
38
|
# @return [void]
|
39
39
|
def upload(source, options = {})
|
40
|
-
Aws::Plugins::UserAgent.
|
40
|
+
Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
|
41
41
|
if File.size(source) >= multipart_threshold
|
42
42
|
MultipartFileUploader.new(@options).upload(source, options)
|
43
43
|
else
|
@@ -46,7 +46,7 @@ module Aws
|
|
46
46
|
# @option options [Integer] :thread_count (THREAD_COUNT)
|
47
47
|
# @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
|
48
48
|
def upload(options = {}, &block)
|
49
|
-
Aws::Plugins::UserAgent.
|
49
|
+
Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
|
50
50
|
upload_id = initiate_upload(options)
|
51
51
|
parts = upload_parts(upload_id, options, &block)
|
52
52
|
complete_upload(upload_id, parts, options)
|
@@ -227,7 +227,7 @@ module Aws::S3
|
|
227
227
|
:retry
|
228
228
|
end
|
229
229
|
end
|
230
|
-
Aws::Plugins::UserAgent.
|
230
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
231
231
|
Aws::Waiters::Waiter.new(options).wait({})
|
232
232
|
end
|
233
233
|
end
|
@@ -268,7 +268,7 @@ module Aws::S3
|
|
268
268
|
key: @object_key,
|
269
269
|
upload_id: @id
|
270
270
|
)
|
271
|
-
resp = Aws::Plugins::UserAgent.
|
271
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
272
272
|
@client.abort_multipart_upload(options)
|
273
273
|
end
|
274
274
|
resp.data
|
@@ -409,7 +409,7 @@ module Aws::S3
|
|
409
409
|
key: @object_key,
|
410
410
|
upload_id: @id
|
411
411
|
)
|
412
|
-
Aws::Plugins::UserAgent.
|
412
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
413
413
|
@client.complete_multipart_upload(options)
|
414
414
|
end
|
415
415
|
Object.new(
|
@@ -519,7 +519,7 @@ module Aws::S3
|
|
519
519
|
key: @object_key,
|
520
520
|
upload_id: @id
|
521
521
|
)
|
522
|
-
resp = Aws::Plugins::UserAgent.
|
522
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
523
523
|
@client.list_parts(options)
|
524
524
|
end
|
525
525
|
resp.each_page do |page|
|
@@ -262,7 +262,7 @@ module Aws::S3
|
|
262
262
|
:retry
|
263
263
|
end
|
264
264
|
end
|
265
|
-
Aws::Plugins::UserAgent.
|
265
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
266
266
|
Aws::Waiters::Waiter.new(options).wait({})
|
267
267
|
end
|
268
268
|
end
|
@@ -500,7 +500,7 @@ module Aws::S3
|
|
500
500
|
upload_id: @multipart_upload_id,
|
501
501
|
part_number: @part_number
|
502
502
|
)
|
503
|
-
resp = Aws::Plugins::UserAgent.
|
503
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
504
504
|
@client.upload_part_copy(options)
|
505
505
|
end
|
506
506
|
resp.data
|
@@ -650,7 +650,7 @@ module Aws::S3
|
|
650
650
|
upload_id: @multipart_upload_id,
|
651
651
|
part_number: @part_number
|
652
652
|
)
|
653
|
-
resp = Aws::Plugins::UserAgent.
|
653
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
654
654
|
@client.upload_part(options)
|
655
655
|
end
|
656
656
|
resp.data
|
data/lib/aws-sdk-s3/object.rb
CHANGED
@@ -500,7 +500,7 @@ module Aws::S3
|
|
500
500
|
#
|
501
501
|
# @return [self]
|
502
502
|
def load
|
503
|
-
resp = Aws::Plugins::UserAgent.
|
503
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
504
504
|
@client.head_object(
|
505
505
|
bucket: @bucket_name,
|
506
506
|
key: @key
|
@@ -550,7 +550,7 @@ module Aws::S3
|
|
550
550
|
options, params = separate_params_and_options(options)
|
551
551
|
waiter = Waiters::ObjectExists.new(options)
|
552
552
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
553
|
-
Aws::Plugins::UserAgent.
|
553
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
554
554
|
waiter.wait(params.merge(bucket: @bucket_name,
|
555
555
|
key: @key))
|
556
556
|
end
|
@@ -571,7 +571,7 @@ module Aws::S3
|
|
571
571
|
options, params = separate_params_and_options(options)
|
572
572
|
waiter = Waiters::ObjectNotExists.new(options)
|
573
573
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
574
|
-
Aws::Plugins::UserAgent.
|
574
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
575
575
|
waiter.wait(params.merge(bucket: @bucket_name,
|
576
576
|
key: @key))
|
577
577
|
end
|
@@ -676,7 +676,7 @@ module Aws::S3
|
|
676
676
|
:retry
|
677
677
|
end
|
678
678
|
end
|
679
|
-
Aws::Plugins::UserAgent.
|
679
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
680
680
|
Aws::Waiters::Waiter.new(options).wait({})
|
681
681
|
end
|
682
682
|
end
|
@@ -1346,7 +1346,7 @@ module Aws::S3
|
|
1346
1346
|
bucket: @bucket_name,
|
1347
1347
|
key: @key
|
1348
1348
|
)
|
1349
|
-
resp = Aws::Plugins::UserAgent.
|
1349
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1350
1350
|
@client.copy_object(options)
|
1351
1351
|
end
|
1352
1352
|
resp.data
|
@@ -1412,7 +1412,7 @@ module Aws::S3
|
|
1412
1412
|
bucket: @bucket_name,
|
1413
1413
|
key: @key
|
1414
1414
|
)
|
1415
|
-
resp = Aws::Plugins::UserAgent.
|
1415
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1416
1416
|
@client.delete_object(options)
|
1417
1417
|
end
|
1418
1418
|
resp.data
|
@@ -1668,7 +1668,7 @@ module Aws::S3
|
|
1668
1668
|
bucket: @bucket_name,
|
1669
1669
|
key: @key
|
1670
1670
|
)
|
1671
|
-
resp = Aws::Plugins::UserAgent.
|
1671
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1672
1672
|
@client.get_object(options, &block)
|
1673
1673
|
end
|
1674
1674
|
resp.data
|
@@ -2153,7 +2153,7 @@ module Aws::S3
|
|
2153
2153
|
bucket: @bucket_name,
|
2154
2154
|
key: @key
|
2155
2155
|
)
|
2156
|
-
resp = Aws::Plugins::UserAgent.
|
2156
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2157
2157
|
@client.create_multipart_upload(options)
|
2158
2158
|
end
|
2159
2159
|
MultipartUpload.new(
|
@@ -2624,7 +2624,7 @@ module Aws::S3
|
|
2624
2624
|
bucket: @bucket_name,
|
2625
2625
|
key: @key
|
2626
2626
|
)
|
2627
|
-
resp = Aws::Plugins::UserAgent.
|
2627
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2628
2628
|
@client.put_object(options)
|
2629
2629
|
end
|
2630
2630
|
resp.data
|
@@ -2765,7 +2765,7 @@ module Aws::S3
|
|
2765
2765
|
bucket: @bucket_name,
|
2766
2766
|
key: @key
|
2767
2767
|
)
|
2768
|
-
resp = Aws::Plugins::UserAgent.
|
2768
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2769
2769
|
@client.restore_object(options)
|
2770
2770
|
end
|
2771
2771
|
resp.data
|
@@ -2936,7 +2936,7 @@ module Aws::S3
|
|
2936
2936
|
bucket: @bucket_name,
|
2937
2937
|
key: @key
|
2938
2938
|
)
|
2939
|
-
resp = Aws::Plugins::UserAgent.
|
2939
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2940
2940
|
@client.head_object(options)
|
2941
2941
|
end
|
2942
2942
|
resp.data
|
@@ -3154,7 +3154,7 @@ module Aws::S3
|
|
3154
3154
|
key: item.key
|
3155
3155
|
}
|
3156
3156
|
end
|
3157
|
-
Aws::Plugins::UserAgent.
|
3157
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
3158
3158
|
batch[0].client.delete_objects(params)
|
3159
3159
|
end
|
3160
3160
|
end
|
@@ -79,7 +79,7 @@ module Aws::S3
|
|
79
79
|
#
|
80
80
|
# @return [self]
|
81
81
|
def load
|
82
|
-
resp = Aws::Plugins::UserAgent.
|
82
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
83
83
|
@client.get_object_acl(
|
84
84
|
bucket: @bucket_name,
|
85
85
|
key: @object_key
|
@@ -199,7 +199,7 @@ module Aws::S3
|
|
199
199
|
:retry
|
200
200
|
end
|
201
201
|
end
|
202
|
-
Aws::Plugins::UserAgent.
|
202
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
203
203
|
Aws::Waiters::Waiter.new(options).wait({})
|
204
204
|
end
|
205
205
|
end
|
@@ -332,7 +332,7 @@ module Aws::S3
|
|
332
332
|
bucket: @bucket_name,
|
333
333
|
key: @object_key
|
334
334
|
)
|
335
|
-
resp = Aws::Plugins::UserAgent.
|
335
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
336
336
|
@client.put_object_acl(options)
|
337
337
|
end
|
338
338
|
resp.data
|
@@ -28,7 +28,7 @@ module Aws
|
|
28
28
|
options[:bucket] = target_bucket
|
29
29
|
options[:key] = target_key
|
30
30
|
options[:copy_source] = copy_source(source)
|
31
|
-
Aws::Plugins::UserAgent.
|
31
|
+
Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
|
32
32
|
if options.delete(:multipart_copy)
|
33
33
|
apply_source_client(source, options)
|
34
34
|
ObjectMultipartCopier.new(@options).copy(options)
|
@@ -186,7 +186,7 @@ module Aws::S3
|
|
186
186
|
options, params = separate_params_and_options(options)
|
187
187
|
waiter = Waiters::ObjectExists.new(options)
|
188
188
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
189
|
-
Aws::Plugins::UserAgent.
|
189
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
190
190
|
waiter.wait(params.merge(bucket: @bucket_name,
|
191
191
|
key: @key))
|
192
192
|
end
|
@@ -207,7 +207,7 @@ module Aws::S3
|
|
207
207
|
options, params = separate_params_and_options(options)
|
208
208
|
waiter = Waiters::ObjectNotExists.new(options)
|
209
209
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
210
|
-
Aws::Plugins::UserAgent.
|
210
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
211
211
|
waiter.wait(params.merge(bucket: @bucket_name,
|
212
212
|
key: @key))
|
213
213
|
end
|
@@ -312,7 +312,7 @@ module Aws::S3
|
|
312
312
|
:retry
|
313
313
|
end
|
314
314
|
end
|
315
|
-
Aws::Plugins::UserAgent.
|
315
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
316
316
|
Aws::Waiters::Waiter.new(options).wait({})
|
317
317
|
end
|
318
318
|
end
|
@@ -982,7 +982,7 @@ module Aws::S3
|
|
982
982
|
bucket: @bucket_name,
|
983
983
|
key: @key
|
984
984
|
)
|
985
|
-
resp = Aws::Plugins::UserAgent.
|
985
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
986
986
|
@client.copy_object(options)
|
987
987
|
end
|
988
988
|
resp.data
|
@@ -1048,7 +1048,7 @@ module Aws::S3
|
|
1048
1048
|
bucket: @bucket_name,
|
1049
1049
|
key: @key
|
1050
1050
|
)
|
1051
|
-
resp = Aws::Plugins::UserAgent.
|
1051
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1052
1052
|
@client.delete_object(options)
|
1053
1053
|
end
|
1054
1054
|
resp.data
|
@@ -1304,7 +1304,7 @@ module Aws::S3
|
|
1304
1304
|
bucket: @bucket_name,
|
1305
1305
|
key: @key
|
1306
1306
|
)
|
1307
|
-
resp = Aws::Plugins::UserAgent.
|
1307
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1308
1308
|
@client.get_object(options, &block)
|
1309
1309
|
end
|
1310
1310
|
resp.data
|
@@ -1789,7 +1789,7 @@ module Aws::S3
|
|
1789
1789
|
bucket: @bucket_name,
|
1790
1790
|
key: @key
|
1791
1791
|
)
|
1792
|
-
resp = Aws::Plugins::UserAgent.
|
1792
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1793
1793
|
@client.create_multipart_upload(options)
|
1794
1794
|
end
|
1795
1795
|
MultipartUpload.new(
|
@@ -2260,7 +2260,7 @@ module Aws::S3
|
|
2260
2260
|
bucket: @bucket_name,
|
2261
2261
|
key: @key
|
2262
2262
|
)
|
2263
|
-
resp = Aws::Plugins::UserAgent.
|
2263
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2264
2264
|
@client.put_object(options)
|
2265
2265
|
end
|
2266
2266
|
resp.data
|
@@ -2401,7 +2401,7 @@ module Aws::S3
|
|
2401
2401
|
bucket: @bucket_name,
|
2402
2402
|
key: @key
|
2403
2403
|
)
|
2404
|
-
resp = Aws::Plugins::UserAgent.
|
2404
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2405
2405
|
@client.restore_object(options)
|
2406
2406
|
end
|
2407
2407
|
resp.data
|
@@ -2628,7 +2628,7 @@ module Aws::S3
|
|
2628
2628
|
key: item.key
|
2629
2629
|
}
|
2630
2630
|
end
|
2631
|
-
Aws::Plugins::UserAgent.
|
2631
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2632
2632
|
batch[0].client.delete_objects(params)
|
2633
2633
|
end
|
2634
2634
|
end
|
@@ -243,7 +243,7 @@ module Aws::S3
|
|
243
243
|
:retry
|
244
244
|
end
|
245
245
|
end
|
246
|
-
Aws::Plugins::UserAgent.
|
246
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
247
247
|
Aws::Waiters::Waiter.new(options).wait({})
|
248
248
|
end
|
249
249
|
end
|
@@ -303,7 +303,7 @@ module Aws::S3
|
|
303
303
|
key: @object_key,
|
304
304
|
version_id: @id
|
305
305
|
)
|
306
|
-
resp = Aws::Plugins::UserAgent.
|
306
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
307
307
|
@client.delete_object(options)
|
308
308
|
end
|
309
309
|
resp.data
|
@@ -530,7 +530,7 @@ module Aws::S3
|
|
530
530
|
key: @object_key,
|
531
531
|
version_id: @id
|
532
532
|
)
|
533
|
-
resp = Aws::Plugins::UserAgent.
|
533
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
534
534
|
@client.get_object(options, &block)
|
535
535
|
end
|
536
536
|
resp.data
|
@@ -694,7 +694,7 @@ module Aws::S3
|
|
694
694
|
key: @object_key,
|
695
695
|
version_id: @id
|
696
696
|
)
|
697
|
-
resp = Aws::Plugins::UserAgent.
|
697
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
698
698
|
@client.head_object(options)
|
699
699
|
end
|
700
700
|
resp.data
|
@@ -868,7 +868,7 @@ module Aws::S3
|
|
868
868
|
version_id: item.id
|
869
869
|
}
|
870
870
|
end
|
871
|
-
Aws::Plugins::UserAgent.
|
871
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
872
872
|
batch[0].client.delete_objects(params)
|
873
873
|
end
|
874
874
|
end
|
@@ -69,11 +69,17 @@ setting, caching, and fallback behavior.
|
|
69
69
|
context[:sigv4_credentials] = credentials # Sign will use this
|
70
70
|
end
|
71
71
|
|
72
|
-
@handler.call(context)
|
72
|
+
with_metric(credentials) { @handler.call(context) }
|
73
73
|
end
|
74
74
|
|
75
75
|
private
|
76
76
|
|
77
|
+
def with_metric(credentials, &block)
|
78
|
+
return block.call unless credentials
|
79
|
+
|
80
|
+
Aws::Plugins::UserAgent.metric('S3_ACCESS_GRANTS', &block)
|
81
|
+
end
|
82
|
+
|
77
83
|
def access_grants_operation?(context)
|
78
84
|
params = context[:endpoint_params]
|
79
85
|
params[:bucket] && PERMISSION_MAP[context.operation_name]
|
@@ -47,11 +47,17 @@ for different buckets.
|
|
47
47
|
context[:sigv4_credentials] = credentials # Sign will use this
|
48
48
|
end
|
49
49
|
end
|
50
|
-
@handler.call(context)
|
50
|
+
with_metric(credentials) { @handler.call(context) }
|
51
51
|
end
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
+
def with_metric(credentials, &block)
|
56
|
+
return block.call unless credentials
|
57
|
+
|
58
|
+
Aws::Plugins::UserAgent.metric('S3_EXPRESS_BUCKET', &block)
|
59
|
+
end
|
60
|
+
|
55
61
|
def checksum_required?(context)
|
56
62
|
context.operation.http_checksum_required ||
|
57
63
|
(context.operation.http_checksum &&
|
@@ -15,22 +15,67 @@ module Aws
|
|
15
15
|
|
16
16
|
def call(context)
|
17
17
|
@handler.call(context).on(200) do |response|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
return response if streaming_output?(context.operation.output)
|
19
|
+
|
20
|
+
error = check_for_error(context)
|
21
|
+
return response unless error
|
22
|
+
|
23
|
+
context.http_response.status_code = 500
|
24
|
+
response.data = nil
|
25
|
+
response.error = error
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
# Streaming outputs are not subject to 200 errors.
|
32
|
+
def streaming_output?(output)
|
33
|
+
if (payload = output[:payload_member])
|
34
|
+
# checking ref and shape
|
35
|
+
payload['streaming'] || payload.shape['streaming'] ||
|
36
|
+
payload.eventstream
|
37
|
+
else
|
38
|
+
false
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Checks if the output shape is a structure shape and has members that
|
43
|
+
# are in the body for the case of a payload and a normal structure. A
|
44
|
+
# non-structure shape will not have members in the body. In the case
|
45
|
+
# of a string or blob, the body contents would have been checked first
|
46
|
+
# before this method is called in incomplete_xml_body?.
|
47
|
+
def members_in_body?(output)
|
48
|
+
shape =
|
49
|
+
if output[:payload_member]
|
50
|
+
output[:payload_member].shape
|
51
|
+
else
|
52
|
+
output.shape
|
22
53
|
end
|
54
|
+
|
55
|
+
if structure_shape?(shape)
|
56
|
+
shape.members.any? { |_, k| k.location.nil? }
|
57
|
+
else
|
58
|
+
false
|
23
59
|
end
|
24
60
|
end
|
25
61
|
|
62
|
+
def structure_shape?(shape)
|
63
|
+
shape.is_a?(Seahorse::Model::Shapes::StructureShape)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Must have a member in the body and have the start of an XML Tag.
|
67
|
+
# Other incomplete xml bodies will result in an XML ParsingError.
|
68
|
+
def incomplete_xml_body?(xml, output)
|
69
|
+
members_in_body?(output) && !xml.match(/<\w/)
|
70
|
+
end
|
71
|
+
|
26
72
|
def check_for_error(context)
|
27
73
|
xml = context.http_response.body_contents
|
28
|
-
if xml.match(
|
74
|
+
if xml.match(/\?>\s*<Error>/)
|
29
75
|
error_code = xml.match(/<Code>(.+?)<\/Code>/)[1]
|
30
76
|
error_message = xml.match(/<Message>(.+?)<\/Message>/)[1]
|
31
77
|
S3::Errors.error_class(error_code).new(context, error_message)
|
32
|
-
elsif
|
33
|
-
# Other incomplete xml bodies will result in XML ParsingError
|
78
|
+
elsif incomplete_xml_body?(xml, context.operation.output)
|
34
79
|
Seahorse::Client::NetworkingError.new(
|
35
80
|
S3::Errors
|
36
81
|
.error_class('InternalError')
|
@@ -40,15 +85,7 @@ module Aws
|
|
40
85
|
end
|
41
86
|
end
|
42
87
|
|
43
|
-
handler(
|
44
|
-
Handler,
|
45
|
-
step: :sign,
|
46
|
-
operations: [
|
47
|
-
:complete_multipart_upload,
|
48
|
-
:copy_object,
|
49
|
-
:upload_part_copy,
|
50
|
-
]
|
51
|
-
)
|
88
|
+
handler(Handler, step: :sign)
|
52
89
|
end
|
53
90
|
end
|
54
91
|
end
|
data/lib/aws-sdk-s3/resource.rb
CHANGED
@@ -166,7 +166,7 @@ module Aws::S3
|
|
166
166
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
|
167
167
|
# @return [Bucket]
|
168
168
|
def create_bucket(options = {})
|
169
|
-
Aws::Plugins::UserAgent.
|
169
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
170
170
|
@client.create_bucket(options)
|
171
171
|
end
|
172
172
|
Bucket.new(
|
@@ -194,7 +194,7 @@ module Aws::S3
|
|
194
194
|
def buckets(options = {})
|
195
195
|
batches = Enumerator.new do |y|
|
196
196
|
batch = []
|
197
|
-
resp = Aws::Plugins::UserAgent.
|
197
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
198
198
|
@client.list_buckets(options)
|
199
199
|
end
|
200
200
|
resp.data.buckets.each do |b|
|
data/lib/aws-sdk-s3.rb
CHANGED
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.154.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: 2024-
|
11
|
+
date: 2024-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '3'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 3.
|
50
|
+
version: 3.199.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '3'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 3.
|
60
|
+
version: 3.199.0
|
61
61
|
description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
|
62
62
|
This gem is part of the AWS SDK for Ruby.
|
63
63
|
email:
|