aws-sdk-s3 1.103.0 → 1.106.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 +20 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +6 -6
- data/lib/aws-sdk-s3/arn/multi_region_access_point_arn.rb +2 -3
- data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +6 -6
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +7 -6
- data/lib/aws-sdk-s3/client.rb +9 -4
- data/lib/aws-sdk-s3/customizations/object.rb +74 -1
- data/lib/aws-sdk-s3/plugins/accelerate.rb +7 -1
- data/lib/aws-sdk-s3/plugins/arn.rb +11 -24
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +1 -1
- data/lib/aws-sdk-s3/plugins/dualstack.rb +25 -31
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +19 -4
- data/lib/aws-sdk-s3.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b88adac8854f4eeb8210735da5ea5087e651c640f9a92e25ed6c4f96ad6ef459
|
4
|
+
data.tar.gz: 64ebe11f97661fb709c52724b4ef3aced1e6fc9b1341c4afd2e00d668b888dea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 776794c0a09c05871bf4bd3ccc6370cb46b9cbace5213acf09e4598509460bb585b8a55263fdc37191b82bba3eb4707b092ef82258e2a59313e527f22a1860f7
|
7
|
+
data.tar.gz: 53a6b5652862a2f053ca06733c7eccd0ea83144ee5f92776eaa6ea4a9002ab3f69b392d7f98ffc3f1991846d3799cf0f099157d5d0fe4fa71a7e444aaa696511
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,26 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.106.0 (2021-11-17)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - Add `presigned_request` method to `Aws::S3::Object`.
|
8
|
+
|
9
|
+
1.105.1 (2021-11-05)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Issue - Raise error when `use_fips_endpoint` is used with `use_accelerate_endpoint`.
|
13
|
+
|
14
|
+
1.105.0 (2021-11-04)
|
15
|
+
------------------
|
16
|
+
|
17
|
+
* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
|
18
|
+
|
19
|
+
1.104.0 (2021-10-18)
|
20
|
+
------------------
|
21
|
+
|
22
|
+
* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
|
23
|
+
|
4
24
|
1.103.0 (2021-09-16)
|
5
25
|
------------------
|
6
26
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.106.0
|
@@ -25,25 +25,25 @@ module Aws
|
|
25
25
|
if @region.empty? || @account_id.empty?
|
26
26
|
raise ArgumentError,
|
27
27
|
'S3 Access Point ARNs must contain both a region '\
|
28
|
-
'and an account
|
28
|
+
'and an account ID.'
|
29
29
|
end
|
30
30
|
|
31
31
|
if @region.include?('-fips') || @region.include?('fips-')
|
32
32
|
raise ArgumentError,
|
33
|
-
'S3 Access Point ARNs cannot contain a FIPS region'
|
33
|
+
'S3 Access Point ARNs cannot contain a FIPS region.'
|
34
34
|
end
|
35
35
|
|
36
36
|
if @type != 'accesspoint'
|
37
|
-
raise ArgumentError, 'Invalid ARN, resource format is not correct'
|
37
|
+
raise ArgumentError, 'Invalid ARN, resource format is not correct.'
|
38
38
|
end
|
39
39
|
|
40
40
|
if @access_point_name.nil? || @access_point_name.empty?
|
41
|
-
raise ArgumentError, 'Missing ARN
|
41
|
+
raise ArgumentError, 'Missing ARN Access Point name.'
|
42
42
|
end
|
43
43
|
|
44
44
|
if @extra
|
45
45
|
raise ArgumentError,
|
46
|
-
'ARN
|
46
|
+
'ARN Access Point resource must be a single value.'
|
47
47
|
end
|
48
48
|
|
49
49
|
unless Seahorse::Util.host_label?(
|
@@ -60,7 +60,7 @@ module Aws
|
|
60
60
|
if custom_endpoint
|
61
61
|
"#{pfx}.#{custom_endpoint}"
|
62
62
|
else
|
63
|
-
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
|
63
|
+
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(region, 's3')
|
64
64
|
"#{pfx}.s3-accesspoint#{'-fips' if fips}#{'.dualstack' if dualstack}.#{region}.#{sfx}"
|
65
65
|
end
|
66
66
|
end
|
@@ -55,12 +55,11 @@ module Aws
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def host_url(
|
58
|
+
def host_url(_region, _fips = false, _dualstack = false, custom_endpoint = nil)
|
59
59
|
if custom_endpoint
|
60
60
|
"#{@mrap_alias}.#{custom_endpoint}"
|
61
61
|
else
|
62
|
-
|
63
|
-
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(@partition)
|
62
|
+
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(@partition, 's3')
|
64
63
|
"#{@mrap_alias}.accesspoint.s3-global.#{sfx}"
|
65
64
|
end
|
66
65
|
end
|
@@ -19,18 +19,18 @@ module Aws
|
|
19
19
|
|
20
20
|
def validate_arn!
|
21
21
|
unless @service == 's3-object-lambda'
|
22
|
-
raise ArgumentError, 'Must provide a valid S3 Object
|
22
|
+
raise ArgumentError, 'Must provide a valid S3 Object Lambda ARN.'
|
23
23
|
end
|
24
24
|
|
25
25
|
if @region.empty? || @account_id.empty?
|
26
26
|
raise ArgumentError,
|
27
27
|
'S3 Object Lambdas ARNs must contain both a region '\
|
28
|
-
'and an account
|
28
|
+
'and an account ID.'
|
29
29
|
end
|
30
30
|
|
31
31
|
if @region.include?('-fips') || @region.include?('fips-')
|
32
32
|
raise ArgumentError,
|
33
|
-
'S3
|
33
|
+
'S3 Object Lambda ARNs cannot contain a FIPS region'
|
34
34
|
end
|
35
35
|
|
36
36
|
if @type != 'accesspoint'
|
@@ -38,12 +38,12 @@ module Aws
|
|
38
38
|
end
|
39
39
|
|
40
40
|
if @access_point_name.nil? || @access_point_name.empty?
|
41
|
-
raise ArgumentError, 'Missing ARN
|
41
|
+
raise ArgumentError, 'Missing ARN Access Point name.'
|
42
42
|
end
|
43
43
|
|
44
44
|
if @extra
|
45
45
|
raise ArgumentError,
|
46
|
-
'ARN
|
46
|
+
'ARN Access Point resource must be a single value.'
|
47
47
|
end
|
48
48
|
|
49
49
|
unless Seahorse::Util.host_label?(
|
@@ -60,7 +60,7 @@ module Aws
|
|
60
60
|
if custom_endpoint
|
61
61
|
"#{pfx}.#{custom_endpoint}"
|
62
62
|
else
|
63
|
-
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
|
63
|
+
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(region, 's3')
|
64
64
|
"#{pfx}.s3-object-lambda#{'-fips' if fips}.#{region}.#{sfx}"
|
65
65
|
end
|
66
66
|
end
|
@@ -20,13 +20,14 @@ module Aws
|
|
20
20
|
|
21
21
|
def validate_arn!
|
22
22
|
unless @service == 's3-outposts'
|
23
|
-
raise ArgumentError, 'Must provide a valid S3
|
23
|
+
raise ArgumentError, 'Must provide a valid S3 Outpost Access '\
|
24
|
+
'Point ARN.'
|
24
25
|
end
|
25
26
|
|
26
27
|
if @region.empty? || @account_id.empty?
|
27
28
|
raise ArgumentError,
|
28
|
-
'S3 Outpost ARNs must contain both a region '\
|
29
|
-
'and an account
|
29
|
+
'S3 Outpost Access Point ARNs must contain both a region '\
|
30
|
+
'and an account ID.'
|
30
31
|
end
|
31
32
|
|
32
33
|
if @type != 'outpost' && @subtype != 'accesspoint'
|
@@ -34,16 +35,16 @@ module Aws
|
|
34
35
|
end
|
35
36
|
|
36
37
|
if @outpost_id.nil? || @outpost_id.empty?
|
37
|
-
raise ArgumentError, 'Missing ARN
|
38
|
+
raise ArgumentError, 'Missing ARN Outpost ID.'
|
38
39
|
end
|
39
40
|
|
40
41
|
if @access_point_name.nil? || @access_point_name.empty?
|
41
|
-
raise ArgumentError, 'Missing ARN
|
42
|
+
raise ArgumentError, 'Missing ARN Access Point name.'
|
42
43
|
end
|
43
44
|
|
44
45
|
if @extra
|
45
46
|
raise ArgumentError,
|
46
|
-
'ARN
|
47
|
+
'ARN Access Point resource must be a single value.'
|
47
48
|
end
|
48
49
|
|
49
50
|
unless Seahorse::Util.host_label?(
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -359,9 +359,14 @@ module Aws::S3
|
|
359
359
|
# for all object operations. You must first enable accelerate for
|
360
360
|
# each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html).
|
361
361
|
#
|
362
|
-
# @option options [Boolean] :use_dualstack_endpoint
|
363
|
-
# When set to `true`,
|
364
|
-
#
|
362
|
+
# @option options [Boolean] :use_dualstack_endpoint
|
363
|
+
# When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
|
364
|
+
# will be used if available.
|
365
|
+
#
|
366
|
+
# @option options [Boolean] :use_fips_endpoint
|
367
|
+
# When set to `true`, fips compatible endpoints will be used if available.
|
368
|
+
# When a `fips` region is used, the region is normalized and this config
|
369
|
+
# is set to `true`.
|
365
370
|
#
|
366
371
|
# @option options [Boolean] :validate_params (true)
|
367
372
|
# When `true`, request parameters are validated before
|
@@ -14061,7 +14066,7 @@ module Aws::S3
|
|
14061
14066
|
params: params,
|
14062
14067
|
config: config)
|
14063
14068
|
context[:gem_name] = 'aws-sdk-s3'
|
14064
|
-
context[:gem_version] = '1.
|
14069
|
+
context[:gem_version] = '1.106.0'
|
14065
14070
|
Seahorse::Client::Request.new(handlers, context)
|
14066
14071
|
end
|
14067
14072
|
|
@@ -161,7 +161,7 @@ module Aws
|
|
161
161
|
#
|
162
162
|
# @param [Symbol] method
|
163
163
|
# The S3 operation to generate a presigned URL for. Valid values
|
164
|
-
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
164
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
165
165
|
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
166
166
|
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
167
167
|
#
|
@@ -215,6 +215,79 @@ module Aws
|
|
215
215
|
)
|
216
216
|
end
|
217
217
|
|
218
|
+
# Allows you to create presigned URL requests for S3 operations. This
|
219
|
+
# method returns a tuple containing the URL and the signed X-amz-* headers
|
220
|
+
# to be used with the presigned url.
|
221
|
+
#
|
222
|
+
# @example Pre-signed GET URL, valid for one hour
|
223
|
+
#
|
224
|
+
# obj.presigned_request(:get, expires_in: 3600)
|
225
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...", {}]
|
226
|
+
#
|
227
|
+
# @example Pre-signed PUT with a canned ACL
|
228
|
+
#
|
229
|
+
# # the object uploaded using this URL will be publicly accessible
|
230
|
+
# obj.presigned_request(:put, acl: 'public-read')
|
231
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...",
|
232
|
+
# {"x-amz-acl"=>"public-read"}]
|
233
|
+
#
|
234
|
+
# @param [Symbol] method
|
235
|
+
# The S3 operation to generate a presigned request for. Valid values
|
236
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
237
|
+
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
238
|
+
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
239
|
+
#
|
240
|
+
# @param [Hash] params
|
241
|
+
# Additional request parameters to use when generating the pre-signed
|
242
|
+
# request. See the related documentation in {Client} for accepted
|
243
|
+
# params.
|
244
|
+
#
|
245
|
+
# | Method | Client Method |
|
246
|
+
# |------------------------------|------------------------------------|
|
247
|
+
# | `:get` | {Client#get_object} |
|
248
|
+
# | `:put` | {Client#put_object} |
|
249
|
+
# | `:head` | {Client#head_object} |
|
250
|
+
# | `:delete` | {Client#delete_object} |
|
251
|
+
# | `:create_multipart_upload` | {Client#create_multipart_upload} |
|
252
|
+
# | `:list_multipart_uploads` | {Client#list_multipart_uploads} |
|
253
|
+
# | `:complete_multipart_upload` | {Client#complete_multipart_upload} |
|
254
|
+
# | `:abort_multipart_upload` | {Client#abort_multipart_upload} |
|
255
|
+
# | `:list_parts` | {Client#list_parts} |
|
256
|
+
# | `:upload_part` | {Client#upload_part} |
|
257
|
+
#
|
258
|
+
# @option params [Boolean] :virtual_host (false) When `true` the
|
259
|
+
# presigned URL will use the bucket name as a virtual host.
|
260
|
+
#
|
261
|
+
# bucket = Aws::S3::Bucket.new('my.bucket.com')
|
262
|
+
# bucket.object('key').presigned_request(virtual_host: true)
|
263
|
+
# #=> ["http://my.bucket.com/key?...", {}]
|
264
|
+
#
|
265
|
+
# @option params [Integer] :expires_in (900) Number of seconds before
|
266
|
+
# the pre-signed URL expires. This may not exceed one week (604800
|
267
|
+
# seconds). Note that the pre-signed URL is also only valid as long as
|
268
|
+
# credentials used to sign it are. For example, when using IAM roles,
|
269
|
+
# temporary tokens generated for signing also have a default expiration
|
270
|
+
# which will affect the effective expiration of the pre-signed URL.
|
271
|
+
#
|
272
|
+
# @raise [ArgumentError] Raised if `:expires_in` exceeds one week
|
273
|
+
# (604800 seconds).
|
274
|
+
#
|
275
|
+
# @return [String, Hash] A tuple with a presigned URL and headers that
|
276
|
+
# should be included with the request.
|
277
|
+
#
|
278
|
+
def presigned_request(method, params = {})
|
279
|
+
presigner = Presigner.new(client: client)
|
280
|
+
|
281
|
+
if %w(delete head get put).include?(method.to_s)
|
282
|
+
method = "#{method}_object".to_sym
|
283
|
+
end
|
284
|
+
|
285
|
+
presigner.presigned_request(
|
286
|
+
method.downcase,
|
287
|
+
params.merge(bucket: bucket_name, key: key)
|
288
|
+
)
|
289
|
+
end
|
290
|
+
|
218
291
|
# Returns the public (un-signed) URL for this object.
|
219
292
|
#
|
220
293
|
# s3.bucket('bucket-name').object('obj-key').public_url
|
@@ -41,11 +41,17 @@ each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/
|
|
41
41
|
accelerate = context.params.delete(:use_accelerate_endpoint)
|
42
42
|
end
|
43
43
|
accelerate = context.config.use_accelerate_endpoint if accelerate.nil?
|
44
|
-
# Raise if :endpoint and
|
44
|
+
# Raise if :endpoint and accelerate are both provided
|
45
45
|
if accelerate && !context.config.regional_endpoint
|
46
46
|
raise ArgumentError,
|
47
47
|
'Cannot use both :use_accelerate_endpoint and :endpoint'
|
48
48
|
end
|
49
|
+
# Raise if :use_fips_endpoint and accelerate are both provided
|
50
|
+
if accelerate && context.config.use_fips_endpoint
|
51
|
+
raise ArgumentError,
|
52
|
+
'Cannot use both :use_accelerate_endpoint and '\
|
53
|
+
':use_fips_endpoint'
|
54
|
+
end
|
49
55
|
context[:use_accelerate_endpoint] = accelerate
|
50
56
|
@handler.call(context)
|
51
57
|
end
|
@@ -77,17 +77,10 @@ result in cross region requests.
|
|
77
77
|
if arn
|
78
78
|
validate_config!(context, arn)
|
79
79
|
|
80
|
-
fips = false
|
81
|
-
if resolved_region.include?('fips')
|
82
|
-
fips = true
|
83
|
-
resolved_region = resolved_region.gsub('fips-', '')
|
84
|
-
.gsub('-fips', '')
|
85
|
-
end
|
86
|
-
|
87
80
|
context.metadata[:s3_arn] = {
|
88
81
|
arn: arn,
|
89
82
|
resolved_region: resolved_region,
|
90
|
-
fips:
|
83
|
+
fips: context.config.use_fips_endpoint,
|
91
84
|
dualstack: extract_dualstack_config!(context)
|
92
85
|
}
|
93
86
|
end
|
@@ -126,7 +119,8 @@ result in cross region requests.
|
|
126
119
|
|
127
120
|
if !arn.support_dualstack? && context[:use_dualstack_endpoint]
|
128
121
|
raise ArgumentError,
|
129
|
-
'Cannot provide an Outpost Access Point
|
122
|
+
'Cannot provide an Outpost Access Point, Object Lambda, '\
|
123
|
+
'or Multi-region Access Point ARN'\
|
130
124
|
' when `:use_dualstack_endpoint` is set to true.'
|
131
125
|
end
|
132
126
|
|
@@ -135,6 +129,12 @@ result in cross region requests.
|
|
135
129
|
'Cannot provide a Multi-region Access Point ARN with '\
|
136
130
|
'`:s3_disable_multiregion_access_points` set to true'
|
137
131
|
end
|
132
|
+
|
133
|
+
if context.config.use_fips_endpoint && !arn.support_fips?
|
134
|
+
raise ArgumentError,
|
135
|
+
'FIPS client regions are not supported for this type '\
|
136
|
+
'of ARN.'
|
137
|
+
end
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
@@ -146,7 +146,7 @@ result in cross region requests.
|
|
146
146
|
s3_arn = resolve_arn_type!(arn)
|
147
147
|
s3_arn.validate_arn!
|
148
148
|
validate_region_config!(s3_arn, region, use_arn_region)
|
149
|
-
region = s3_arn.region if use_arn_region
|
149
|
+
region = s3_arn.region if use_arn_region
|
150
150
|
[region, s3_arn]
|
151
151
|
else
|
152
152
|
[region]
|
@@ -231,19 +231,6 @@ result in cross region requests.
|
|
231
231
|
raise Aws::Errors::InvalidARNPartitionError
|
232
232
|
end
|
233
233
|
else
|
234
|
-
if region.include?('fips')
|
235
|
-
# If ARN type doesn't support FIPS but the client region is FIPS
|
236
|
-
unless arn.support_fips?
|
237
|
-
raise ArgumentError,
|
238
|
-
'FIPS client regions are not supported for this type '\
|
239
|
-
'of ARN.'
|
240
|
-
end
|
241
|
-
|
242
|
-
fips = true
|
243
|
-
# Normalize the region so we can compare partition and regions
|
244
|
-
region = region.gsub('fips-', '').gsub('-fips', '')
|
245
|
-
end
|
246
|
-
|
247
234
|
# use_arn_region does not apply to MRAP (global) arns
|
248
235
|
unless arn.region.empty?
|
249
236
|
# Raise if the ARN and client regions are in different partitions
|
@@ -254,7 +241,7 @@ result in cross region requests.
|
|
254
241
|
|
255
242
|
# Raise if regions mismatch
|
256
243
|
# Either when it's a fips client or not using the ARN region
|
257
|
-
if
|
244
|
+
if !use_arn_region && region != arn.region
|
258
245
|
raise Aws::Errors::InvalidARNRegionError
|
259
246
|
end
|
260
247
|
end
|
@@ -5,18 +5,9 @@ module Aws
|
|
5
5
|
module Plugins
|
6
6
|
# @api private
|
7
7
|
class Dualstack < Seahorse::Client::Plugin
|
8
|
-
|
9
|
-
option(:use_dualstack_endpoint,
|
10
|
-
default: false,
|
11
|
-
doc_type: 'Boolean',
|
12
|
-
docstring: <<-DOCS)
|
13
|
-
When set to `true`, IPv6-compatible bucket endpoints will be used
|
14
|
-
for all operations.
|
15
|
-
DOCS
|
16
|
-
|
17
8
|
def add_handlers(handlers, config)
|
18
9
|
handlers.add(OptionHandler, step: :initialize)
|
19
|
-
handlers.add(DualstackHandler, step: :build, priority:
|
10
|
+
handlers.add(DualstackHandler, step: :build, priority: 49)
|
20
11
|
end
|
21
12
|
|
22
13
|
# @api private
|
@@ -40,38 +31,41 @@ for all operations.
|
|
40
31
|
# @api private
|
41
32
|
class DualstackHandler < Seahorse::Client::Handler
|
42
33
|
def call(context)
|
43
|
-
if
|
34
|
+
# only rewrite the endpoint if it's not a custom endpoint
|
35
|
+
# accelerate/ARN already handle dualstack cases, so ignore these
|
36
|
+
# check to see if dualstack is on but configured off via operation
|
37
|
+
if context.config.regional_endpoint &&
|
38
|
+
use_dualstack_endpoint?(context)
|
44
39
|
apply_dualstack_endpoint(context)
|
45
40
|
end
|
46
41
|
@handler.call(context)
|
47
42
|
end
|
48
43
|
|
49
44
|
private
|
50
|
-
def apply_dualstack_endpoint(context)
|
51
|
-
bucket_name = context.params[:bucket]
|
52
|
-
region = context.config.region
|
53
|
-
dns_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
|
54
45
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
46
|
+
def apply_dualstack_endpoint(context)
|
47
|
+
new_endpoint = Aws::Partitions::EndpointProvider.resolve(
|
48
|
+
context.config.region,
|
49
|
+
's3',
|
50
|
+
'regional',
|
51
|
+
{
|
52
|
+
dualstack: context[:use_dualstack_endpoint],
|
53
|
+
fips: context.config.use_fips_endpoint
|
54
|
+
}
|
55
|
+
)
|
60
56
|
endpoint = URI.parse(context.http_request.endpoint.to_s)
|
61
|
-
endpoint.
|
62
|
-
|
63
|
-
endpoint.host = host
|
64
|
-
context.http_request.endpoint = endpoint.to_s
|
65
|
-
end
|
66
|
-
|
67
|
-
def use_bucket_dns?(bucket_name, context)
|
68
|
-
ssl = context.http_request.endpoint.scheme == "https"
|
69
|
-
bucket_name && BucketDns.dns_compatible?(bucket_name, ssl) &&
|
70
|
-
!context.config.force_path_style
|
57
|
+
endpoint.host = URI.parse(new_endpoint).host
|
58
|
+
context.http_request.endpoint = endpoint
|
71
59
|
end
|
72
60
|
|
73
61
|
def use_dualstack_endpoint?(context)
|
74
|
-
|
62
|
+
# case when dualstack is turned off via operation
|
63
|
+
(context[:use_dualstack_endpoint] ||
|
64
|
+
context.config.use_dualstack_endpoint) &&
|
65
|
+
# accelerate plugin already applies dualstack
|
66
|
+
!context[:use_accelerate_endpoint] &&
|
67
|
+
# arns handle dualstack
|
68
|
+
!context.metadata[:s3_arn]
|
75
69
|
end
|
76
70
|
end
|
77
71
|
|
@@ -22,7 +22,9 @@ module Aws
|
|
22
22
|
# S3 removes core's signature_v4 plugin that checks for this
|
23
23
|
raise Aws::Errors::MissingRegionError if cfg.region.nil?
|
24
24
|
|
25
|
-
Aws::Partitions::EndpointProvider.signing_region(
|
25
|
+
Aws::Partitions::EndpointProvider.signing_region(
|
26
|
+
cfg.region, 's3'
|
27
|
+
)
|
26
28
|
end
|
27
29
|
|
28
30
|
def add_handlers(handlers, cfg)
|
@@ -162,7 +164,12 @@ module Aws
|
|
162
164
|
|
163
165
|
def custom_endpoint?(resp)
|
164
166
|
resolved_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(
|
165
|
-
resp.context.config.region
|
167
|
+
resp.context.config.region,
|
168
|
+
's3',
|
169
|
+
{
|
170
|
+
dualstack: resp.context[:use_dualstack_endpoint],
|
171
|
+
fips: resp.context.config.use_fips_endpoint
|
172
|
+
}
|
166
173
|
)
|
167
174
|
!resp.context.http_request.endpoint.hostname.include?(resolved_suffix)
|
168
175
|
end
|
@@ -234,12 +241,20 @@ module Aws
|
|
234
241
|
# Otherwise it will retry with the ARN as the bucket name.
|
235
242
|
def new_hostname(context, region)
|
236
243
|
uri = URI.parse(
|
237
|
-
Aws::Partitions::EndpointProvider.resolve(
|
244
|
+
Aws::Partitions::EndpointProvider.resolve(
|
245
|
+
region, 's3', 'regional',
|
246
|
+
{
|
247
|
+
dualstack: context[:use_dualstack_endpoint],
|
248
|
+
fips: context.config.use_fips_endpoint
|
249
|
+
}
|
250
|
+
)
|
238
251
|
)
|
239
252
|
|
240
253
|
if (arn = context.metadata[:s3_arn])
|
241
254
|
# Retry with the response region and not the ARN resolved one
|
242
|
-
ARN.resolve_url!(
|
255
|
+
ARN.resolve_url!(
|
256
|
+
uri, arn[:arn], region, arn[:fips], arn[:dualstack]
|
257
|
+
).host
|
243
258
|
else
|
244
259
|
"#{context.params[:bucket]}.#{uri.host}"
|
245
260
|
end
|
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.106.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: 2021-
|
11
|
+
date: 2021-11-17 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.122.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.122.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:
|