fog-aws 3.15.0 → 3.18.0

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: e4dabf89bd737334e85935e36486ca9ba38819c8fc7ce16bae50c5bc9cd73917
4
- data.tar.gz: d29ec0b26cd7917860e1d8a492b68fd24a3b6d64adbece07a90f6520361e9c29
3
+ metadata.gz: bd719ef24c69a6ef93d8b15e4c8304b32a4b762cd6054c4506233c4184197ba9
4
+ data.tar.gz: 556c9dfb1b9cc3f56e5d5fdac16db6484261f56417357de67468f1e7e7c7e5fe
5
5
  SHA512:
6
- metadata.gz: 4d42a8e95ae968471cc18dfd49d9444957ec970b0362a5a8f7736db04dd0fc5f0da17dd1e946585caff3de8d8d93da1784ed42aa660df72cb479553b04e9bbc9
7
- data.tar.gz: 9fd1fe20b8aa767fc6cb925293c042c71af77b554176232c9a24a9fe66323671739174453e3bb687465b33c18493f3c5590adca1a82ee5f3ec6405db91260840
6
+ metadata.gz: 2e1b1a7646803fea71d698b0bdca79bae49bdac336536e56fca0ca06a0a9f33dda197e72fde65c4871da40c440618521c66edf91b0aa114444e60badeef39708
7
+ data.tar.gz: 2cc2a96a966d3eff885333fbcd53502505ab64091cc477a0e13a7a0d166749843bdd7afd6a3b67a45c6cdfa9e9ebc09c3e09c84c0e9003d473d8046c5a204423
data/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.18.0](https://github.com/fog/fog-aws/tree/v3.18.0) (2023-02-16)
4
+
5
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.17.0...v3.18.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Only compute SSE-C headers when needed in multipart upload [\#669](https://github.com/fog/fog-aws/pull/669) ([stanhu](https://github.com/stanhu))
10
+
11
+ ## [v3.17.0](https://github.com/fog/fog-aws/tree/v3.17.0) (2023-02-09)
12
+
13
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.16.0...v3.17.0)
14
+
15
+ **Merged pull requests:**
16
+
17
+ - Support disabling of Content-MD5 for FIPS [\#668](https://github.com/fog/fog-aws/pull/668) ([stanhu](https://github.com/stanhu))
18
+
19
+ ## [v3.16.0](https://github.com/fog/fog-aws/tree/v3.16.0) (2023-01-26)
20
+
21
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.15.0...v3.16.0)
22
+
23
+ **Closed issues:**
24
+
25
+ - README lists incorrect usage of IAM auth [\#663](https://github.com/fog/fog-aws/issues/663)
26
+ - How can i config to use s3 in localstack [\#657](https://github.com/fog/fog-aws/issues/657)
27
+ - Fog::Storage::AWS::Files#each always iterates over entire collection [\#232](https://github.com/fog/fog-aws/issues/232)
28
+ - superclass mismatch for class AWS [\#655](https://github.com/fog/fog-aws/issues/655)
29
+ - Lambda IAM Role Not Working [\#650](https://github.com/fog/fog-aws/issues/650)
30
+
31
+ **Merged pull requests:**
32
+
33
+ - adding missing region ap-southeast-4 [\#665](https://github.com/fog/fog-aws/pull/665) ([emptyhammond](https://github.com/emptyhammond))
34
+ o
35
+ - adding missing region eu-south-2 [\#662](https://github.com/fog/fog-aws/pull/662) ([ivangool](https://github.com/ivangool))
36
+ - Bump actions/dependency-review-action from 2 to 3 [\#659](https://github.com/fog/fog-aws/pull/659) ([dependabot[bot]](https://github.com/apps/dependabot))
37
+ - Update aws.rb [\#658](https://github.com/fog/fog-aws/pull/658) ([ivangool](https://github.com/ivangool))
38
+ - Bump actions/stale from 5 to 6 [\#656](https://github.com/fog/fog-aws/pull/656) ([dependabot[bot]](https://github.com/apps/dependabot))
39
+
3
40
  ## [v3.15.0](https://github.com/fog/fog-aws/tree/v3.15.0) (2022-09-12)
4
41
 
5
42
  [Full Changelog](https://github.com/fog/fog-aws/compare/v3.14.0...v3.15.0)
data/README.md CHANGED
@@ -132,7 +132,7 @@ that will not last as long as its requested expiration time if
132
132
  the remainder of the authentication token lifetime was shorter.
133
133
 
134
134
  ```ruby
135
- s3 = Fog::Storage.new(provider: 'AWS', use_iam_auth: true)
135
+ s3 = Fog::Storage.new(provider: 'AWS', use_iam_profile: true)
136
136
  directory = s3.directories.get('gaudi-portal-dev', prefix: 'user/1/')
137
137
 
138
138
  directory.files.new(key: 'user/1/Gemfile').url(Time.now + 60)
@@ -154,7 +154,7 @@ is lower than 60 seconds:
154
154
  ```ruby
155
155
  s3 = Fog::Storage.new(
156
156
  provider: 'AWS',
157
- use_iam_auth: true,
157
+ use_iam_profile: true,
158
158
  aws_credentials_refresh_threshold_seconds: 60
159
159
  )
160
160
  directory = s3.directories.get('gaudi-portal-dev', prefix: 'user/1/')
@@ -335,12 +335,12 @@ module Fog
335
335
  body.rewind rescue nil
336
336
  end
337
337
  while (chunk = body.read(multipart_chunk_size)) do
338
- part_upload = service.upload_part(directory.key, key, upload_id, part_tags.size + 1, chunk, part_headers(chunk, options))
338
+ part_upload = service.upload_part(directory.key, key, upload_id, part_tags.size + 1, chunk, part_headers(chunk))
339
339
  part_tags << part_upload.headers["ETag"]
340
340
  end
341
341
 
342
342
  if part_tags.empty? #it is an error to have a multipart upload with no parts
343
- part_upload = service.upload_part(directory.key, key, upload_id, 1, '', part_headers('', options))
343
+ part_upload = service.upload_part(directory.key, key, upload_id, 1, '', part_headers(''))
344
344
  part_tags << part_upload.headers["ETag"]
345
345
  end
346
346
 
@@ -387,11 +387,18 @@ module Fog
387
387
  end
388
388
  end
389
389
 
390
- def part_headers(chunk, options)
391
- md5 = Base64.encode64(OpenSSL::Digest::MD5.digest(chunk)).strip
392
- encryption_keys = encryption_customer_key_headers.keys
393
- encryption_headers = options.select { |key| encryption_keys.include?(key) }
394
- { 'Content-MD5' => md5 }.merge(encryption_headers)
390
+ def part_headers(chunk)
391
+ base_headers = part_checksum_headers(chunk)
392
+
393
+ # Only SSE-C headers needed in the UploadPart request. [1]
394
+ # x-amz-server-side-encryption and
395
+ # x-amz-server-side-encryption-aws-kms-key-id are only needed
396
+ # in the CreateMultipartUpload request. [2]
397
+ # [1] https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html
398
+ # [2] https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html
399
+ base_headers.merge!(encryption_customer_key_headers) if encryption && encryption_key
400
+
401
+ base_headers
395
402
  end
396
403
 
397
404
  def encryption_customer_key_headers
@@ -402,6 +409,14 @@ module Fog
402
409
  }
403
410
  end
404
411
 
412
+ def part_checksum_headers(chunk)
413
+ if service.disable_content_md5_validation
414
+ {}
415
+ else
416
+ { 'Content-MD5' => Base64.encode64(OpenSSL::Digest::MD5.digest(chunk)).strip }
417
+ end
418
+ end
419
+
405
420
  def create_part_list(upload_part_options)
406
421
  current_pos = 0
407
422
  count = 0
@@ -46,7 +46,7 @@ module Fog
46
46
  ]
47
47
 
48
48
  requires :aws_access_key_id, :aws_secret_access_key
49
- recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname, :max_put_chunk_size, :max_copy_chunk_size, :aws_credentials_refresh_threshold_seconds
49
+ recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname, :max_put_chunk_size, :max_copy_chunk_size, :aws_credentials_refresh_threshold_seconds, :disable_content_md5_validation
50
50
 
51
51
  secrets :aws_secret_access_key, :hmac
52
52
 
@@ -119,6 +119,7 @@ module Fog
119
119
 
120
120
  module Utils
121
121
  attr_accessor :region
122
+ attr_accessor :disable_content_md5_validation
122
123
 
123
124
  # Amazon S3 limits max chunk size that can be uploaded/copied in a single request to 5GB.
124
125
  # Other S3-compatible storages (like, Ceph) do not have such limit.
@@ -486,6 +487,8 @@ module Fog
486
487
  init_max_put_chunk_size!(options)
487
488
  init_max_copy_chunk_size!(options)
488
489
 
490
+ @disable_content_md5_validation = options[:disable_content_md5_validation] || false
491
+
489
492
  @signature_version = options.fetch(:aws_signature_version, 4)
490
493
  validate_signature_version!
491
494
  setup_credentials(options)
@@ -554,6 +557,8 @@ module Fog
554
557
  init_max_put_chunk_size!(options)
555
558
  init_max_copy_chunk_size!(options)
556
559
 
560
+ @disable_content_md5_validation = options[:disable_content_md5_validation] || false
561
+
557
562
  @region = options[:region] || DEFAULT_REGION
558
563
 
559
564
  if @endpoint = options[:endpoint]
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "3.15.0"
3
+ VERSION = "3.18.0"
4
4
  end
5
5
  end
data/lib/fog/aws.rb CHANGED
@@ -224,13 +224,13 @@ module Fog
224
224
  'ap-east-1',
225
225
  'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3',
226
226
  'ap-south-1',
227
- 'ap-southeast-1', 'ap-southeast-2',
227
+ 'ap-southeast-1', 'ap-southeast-2', 'ap-southeast-3', 'ap-southeast-4',
228
228
  'ca-central-1',
229
229
  'cn-north-1',
230
230
  'cn-northwest-1',
231
231
  'eu-central-1',
232
232
  'eu-north-1',
233
- 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-south-1',
233
+ 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-south-1', 'eu-south-2',
234
234
  'me-south-1',
235
235
  'us-east-1', 'us-east-2',
236
236
  'us-west-1', 'us-west-2',
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.15.0
4
+ version: 3.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
8
8
  - Wesley Beary
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-09-12 00:00:00.000000000 Z
12
+ date: 2023-02-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -1443,7 +1443,7 @@ homepage: https://github.com/fog/fog-aws
1443
1443
  licenses:
1444
1444
  - MIT
1445
1445
  metadata: {}
1446
- post_install_message:
1446
+ post_install_message:
1447
1447
  rdoc_options: []
1448
1448
  require_paths:
1449
1449
  - lib
@@ -1458,8 +1458,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1458
1458
  - !ruby/object:Gem::Version
1459
1459
  version: '0'
1460
1460
  requirements: []
1461
- rubygems_version: 3.3.5
1462
- signing_key:
1461
+ rubygems_version: 3.4.1
1462
+ signing_key:
1463
1463
  specification_version: 4
1464
1464
  summary: Module for the 'fog' gem to support Amazon Web Services.
1465
1465
  test_files: []