aws-sdk-s3 1.93.0 → 1.93.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65f1d3671e23de751982bd25a5481612d1cf95d7a9d99e5c7946bc78f38ca49b
4
- data.tar.gz: '069c0978d08f329e2f4b849c51287d144930dced9c46920d5c12ae733c0097ed'
3
+ metadata.gz: 9720f4044b674d912ad1b52f866a0d433358503dd6cf4d8aa11391619674a15d
4
+ data.tar.gz: 6e6ddada3db5629e08660364136608876ce4bac0076ad31a203dd90d9ad52c17
5
5
  SHA512:
6
- metadata.gz: 40e332366cf470ed55ca8397e1ffd6ffa9fc18d51db47791c0efea224a4e626d97533b08fffa881fc7e3ab77252009ca393e2573ad9e28e636724270c3ccc2c6
7
- data.tar.gz: 73c4e75ceb0b8ea668025c830f1ecfa577527e663c77b149a5a533988c40e43ba2016122db1244b927adbe6a6eba3ad95cc2d54925993a66cb4d1d0380bcf739
6
+ metadata.gz: 769072321971f35f4fc668628908f9efeb4565a90a7aa1575fe71b59d01e6049899e48d468c59dd2fb540cdccb5fbe5de70dacebbc2081fd578a326cf5a93d23
7
+ data.tar.gz: 449f8325e0e316b16cff1e0fef1e108072cd5aade0eb4581db803645d9568fb925b6472ae95d6694666b819cb4606830a6d7606d71a476b077d4af66e80ba4fd
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.93.1 (2021-04-12)
5
+ ------------------
6
+
7
+ * Issue - Fix FIPS and global endpoint behavior for S3 ARNs.
8
+
9
+ * Issue - Increases `multipart_threshold` default from 15 megabytes to 100 megabytes.
10
+
4
11
  1.93.0 (2021-03-24)
5
12
  ------------------
6
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.93.0
1
+ 1.93.1
data/lib/aws-sdk-s3.rb CHANGED
@@ -69,6 +69,6 @@ require_relative 'aws-sdk-s3/event_streams'
69
69
  # @!group service
70
70
  module Aws::S3
71
71
 
72
- GEM_VERSION = '1.93.0'
72
+ GEM_VERSION = '1.93.1'
73
73
 
74
74
  end
@@ -9,8 +9,6 @@ module Aws
9
9
  @type, @access_point_name, @extra = @resource.split(/[:,\/]/)
10
10
  end
11
11
 
12
- attr_reader :access_point_name
13
-
14
12
  def support_dualstack?
15
13
  true
16
14
  end
@@ -52,13 +50,13 @@ module Aws
52
50
  end
53
51
  end
54
52
 
55
- def host_url(region, dualstack = false, custom_endpoint = nil)
53
+ def host_url(region, fips = false, dualstack = false, custom_endpoint = nil)
56
54
  pfx = "#{@access_point_name}-#{@account_id}"
57
55
  if custom_endpoint
58
56
  "#{pfx}.#{custom_endpoint}"
59
57
  else
60
58
  sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
61
- "#{pfx}.s3-accesspoint#{'.dualstack' if dualstack}.#{region}.#{sfx}"
59
+ "#{pfx}.s3-accesspoint#{'-fips' if fips}#{'.dualstack' if dualstack}.#{region}.#{sfx}"
62
60
  end
63
61
  end
64
62
  end
@@ -9,8 +9,6 @@ module Aws
9
9
  @type, @access_point_name, @extra = @resource.split(/[:,\/]/)
10
10
  end
11
11
 
12
- attr_reader :access_point_name
13
-
14
12
  def support_dualstack?
15
13
  false
16
14
  end
@@ -52,13 +50,13 @@ module Aws
52
50
  end
53
51
  end
54
52
 
55
- def host_url(region, _dualstack = false, custom_endpoint = nil)
53
+ def host_url(region, fips = false, _dualstack = false, custom_endpoint = nil)
56
54
  pfx = "#{@access_point_name}-#{@account_id}"
57
55
  if custom_endpoint
58
56
  "#{pfx}.#{custom_endpoint}"
59
57
  else
60
58
  sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(region)
61
- "#{pfx}.s3-object-lambda.#{region}.#{sfx}"
59
+ "#{pfx}.s3-object-lambda#{'-fips' if fips}.#{region}.#{sfx}"
62
60
  end
63
61
  end
64
62
  end
@@ -10,8 +10,6 @@ module Aws
10
10
  @resource.split(/[:,\/]/)
11
11
  end
12
12
 
13
- attr_reader :outpost_id, :access_point_name
14
-
15
13
  def support_dualstack?
16
14
  false
17
15
  end
@@ -62,7 +60,7 @@ module Aws
62
60
  end
63
61
 
64
62
  # Outpost ARNs currently do not support dualstack
65
- def host_url(region, _dualstack = false, custom_endpoint = nil)
63
+ def host_url(region, _fips = false, _dualstack = false, custom_endpoint = nil)
66
64
  pfx = "#{@access_point_name}-#{@account_id}.#{@outpost_id}"
67
65
  if custom_endpoint
68
66
  "#{pfx}.#{custom_endpoint}"
@@ -13910,7 +13910,7 @@ module Aws::S3
13910
13910
  params: params,
13911
13911
  config: config)
13912
13912
  context[:gem_name] = 'aws-sdk-s3'
13913
- context[:gem_version] = '1.93.0'
13913
+ context[:gem_version] = '1.93.1'
13914
13914
  Seahorse::Client::Request.new(handlers, context)
13915
13915
  end
13916
13916
 
@@ -7,7 +7,7 @@ module Aws
7
7
  # @api private
8
8
  class FileUploader
9
9
 
10
- FIFTEEN_MEGABYTES = 15 * 1024 * 1024
10
+ ONE_HUNDRED_MEGABYTES = 100 * 1024 * 1024
11
11
 
12
12
  # @param [Hash] options
13
13
  # @option options [Client] :client
@@ -16,7 +16,7 @@ module Aws
16
16
  @options = options
17
17
  @client = options[:client] || Client.new
18
18
  @multipart_threshold = options[:multipart_threshold] ||
19
- FIFTEEN_MEGABYTES
19
+ ONE_HUNDRED_MEGABYTES
20
20
  end
21
21
 
22
22
  # @return [Client]
@@ -39,6 +39,7 @@ be made. Set to `false` to use the client's region instead.
39
39
  context.http_request.endpoint,
40
40
  context.metadata[:s3_arn][:arn],
41
41
  context.metadata[:s3_arn][:resolved_region],
42
+ context.metadata[:s3_arn][:fips],
42
43
  context.metadata[:s3_arn][:dualstack],
43
44
  # if regional_endpoint is false, a custom endpoint was provided
44
45
  # in this case, we want to prefix the endpoint using the ARN
@@ -63,9 +64,17 @@ be made. Set to `false` to use the client's region instead.
63
64
  if arn
64
65
  validate_config!(context, arn)
65
66
 
67
+ fips = false
68
+ if resolved_region.include?('fips')
69
+ fips = true
70
+ resolved_region = resolved_region.gsub('fips-', '')
71
+ .gsub('-fips', '')
72
+ end
73
+
66
74
  context.metadata[:s3_arn] = {
67
75
  arn: arn,
68
76
  resolved_region: resolved_region,
77
+ fips: fips,
69
78
  dualstack: extract_dualstack_config!(context)
70
79
  }
71
80
  end
@@ -118,7 +127,7 @@ be made. Set to `false` to use the client's region instead.
118
127
  s3_arn = resolve_arn_type!(arn)
119
128
  s3_arn.validate_arn!
120
129
  validate_region_config!(s3_arn, region, use_arn_region)
121
- region = s3_arn.region if use_arn_region
130
+ region = s3_arn.region if use_arn_region && !region.include?('fips')
122
131
  [region, s3_arn]
123
132
  else
124
133
  [region]
@@ -126,9 +135,9 @@ be made. Set to `false` to use the client's region instead.
126
135
  end
127
136
 
128
137
  # @api private
129
- def resolve_url!(url, arn, region, dualstack = false, has_custom_endpoint = false)
138
+ def resolve_url!(url, arn, region, fips = false, dualstack = false, has_custom_endpoint = false)
130
139
  custom_endpoint = url.host if has_custom_endpoint
131
- url.host = arn.host_url(region, dualstack, custom_endpoint)
140
+ url.host = arn.host_url(region, fips, dualstack, custom_endpoint)
132
141
  url.path = url_path(url.path, arn)
133
142
  url
134
143
  end
@@ -174,33 +183,40 @@ be made. Set to `false` to use the client's region instead.
174
183
  end
175
184
 
176
185
  def validate_region_config!(arn, region, use_arn_region)
177
- fips = arn.support_fips?
178
-
179
- # s3-external-1 is specific just to s3 and not part of partitions
180
- # aws-global is a partition region
181
- unless arn.partition == 'aws' &&
182
- (region == 's3-external-1' || region == 'aws-global')
183
- if !fips && arn.region.include?('fips')
184
- raise ArgumentError,
185
- 'FIPS region ARNs are not supported for this type of ARN.'
186
+ if ['s3-external-1', 'aws-global'].include?(region)
187
+ # These "regions" are not regional endpoints
188
+ unless use_arn_region
189
+ raise Aws::Errors::InvalidARNRegionError,
190
+ 'Configured client region is not a regional endpoint.'
186
191
  end
187
-
188
- if !fips && !use_arn_region && region.include?('fips')
189
- raise ArgumentError,
190
- 'FIPS client regions are not supported for this type of '\
191
- 'ARN without `:s3_use_arn_region`.'
192
+ # These "regions" are in the AWS partition
193
+ # Cannot use ARN region unless it's the same partition
194
+ unless arn.partition == 'aws'
195
+ raise Aws::Errors::InvalidARNPartitionError
192
196
  end
193
-
194
- # if it's a fips region, attempt to normalize it
195
- if fips || use_arn_region
197
+ else
198
+ if region.include?('fips')
199
+ # If ARN type doesn't support FIPS but the client region is FIPS
200
+ unless arn.support_fips?
201
+ raise ArgumentError,
202
+ 'FIPS client regions are not supported for this type '\
203
+ 'of ARN.'
204
+ end
205
+
206
+ fips = true
207
+ # Normalize the region so we can compare partition and regions
196
208
  region = region.gsub('fips-', '').gsub('-fips', '')
197
209
  end
210
+
211
+ # Raise if the ARN and client regions are in different partitions
198
212
  if use_arn_region &&
199
213
  !Aws::Partitions.partition(arn.partition).region?(region)
200
214
  raise Aws::Errors::InvalidARNPartitionError
201
215
  end
202
216
 
203
- if !use_arn_region && region != arn.region
217
+ # Raise if regions mismatch
218
+ # Either when it's a fips client or not using the ARN region
219
+ if (!use_arn_region || fips) && region != arn.region
204
220
  raise Aws::Errors::InvalidARNRegionError
205
221
  end
206
222
  end
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.93.0
4
+ version: 1.93.1
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-03-24 00:00:00.000000000 Z
11
+ date: 2021-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms