aws-sdk-s3 1.104.0 → 1.105.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 +5 -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/plugins/accelerate.rb +1 -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: 3570e4d131d777fc468050c52e0c742650eac6f7ba0642303a09a62cca1e0c03
|
4
|
+
data.tar.gz: f9bbe42b3c4c7f772d499a83334ce234c62eeed8fd3e752a4b3dcbc70972f1d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 023fc37fe1dd4f1315892fa933c5095e55c2a70cfb170ef195c62024a8e1533688dfec9f09550127937434f28acbfe618968c302eafb6a0deeeb700de2a22a8e
|
7
|
+
data.tar.gz: 9949a6da8a8ce2ebc73415516a3344398a90b14c0d55c013360e4ecfac488cdef3550b950777738baebd999a3ccc41091e5a1d6704893fe9f32a29af7a61bed1
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.105.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.105.0'
|
14065
14070
|
Seahorse::Client::Request.new(handlers, context)
|
14066
14071
|
end
|
14067
14072
|
|
@@ -41,7 +41,7 @@ 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'
|
@@ -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.105.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-04 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:
|