fog-aws 3.26.0 → 3.28.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: d377b351cc65edd82e4a62ebe1ae39e76f8bb820d4ef81de7b2780481e032f57
4
- data.tar.gz: a270c2bca933d588509dfc86ff998431a9beb503cbab891fb399c1d63b45a77b
3
+ metadata.gz: 0b81862bafa0db522d573c2349e8505c3d66c3aeaae51a0c8daa2e6ba6bd1db8
4
+ data.tar.gz: 4d4fac1aaffa73b888fca2c3b244a85c99d23fb288831947c3c8ffa3f0e7a23b
5
5
  SHA512:
6
- metadata.gz: 3e2625dd426856c37532ae2183eab70d8ded2fb262e7e411ba92c0c191b3c59d247d90d25f495fc4fd320b69c79f6c30b90e594d1b0c48ca38c9a2c33803e99b
7
- data.tar.gz: f348c94db7db53197f4fedbaff838b122de1a6537d5570f3e45e316745441ef4e76d4c38c90021c3e6bb4f45f06dc5e0ab6bec4b350953cdf947609162b40fdc
6
+ metadata.gz: c1cd8afc6b7455b6392c55fd2483eb9ac2b0314e3ecd8757e46c3b7462ec9a7f90ab8058310d2ebdfa966e685b983ce7fd93ae834bb86ff44b2e7bac7022473d
7
+ data.tar.gz: 640fb216fc8e201576b249aab161b1b6e125f1dc7f331f95c394b03f07b891c3e02ae5f75b344d3ecd4a19c0b912512904b48b6796b632b47d9e0cd271489e47
data/CHANGELOG.md CHANGED
@@ -1,42 +1,32 @@
1
1
  # Changelog
2
2
 
3
- ## [v3.26.0](https://github.com/fog/fog-aws/tree/v3.26.0) (2024-09-10)
3
+ ## [v3.28.0](https://github.com/fog/fog-aws/tree/v3.28.0) (2024-10-14)
4
4
 
5
- [Full Changelog](https://github.com/fog/fog-aws/compare/v3.25.0...v3.26.0)
5
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.27.0...v3.28.0)
6
6
 
7
- **Merged pull requests:**
7
+ **Closed issues:**
8
8
 
9
- - Support AWS\_ENDPOINT\_URL\_STS environment variable [\#724](https://github.com/fog/fog-aws/pull/724) ([stanhu](https://github.com/stanhu))
9
+ - SES needs to support AWS SigV4 [\#726](https://github.com/fog/fog-aws/issues/726)
10
10
 
11
- ## [v3.25.0](https://github.com/fog/fog-aws/tree/v3.25.0) (2024-08-29)
11
+ **Merged pull requests:**
12
12
 
13
- [Full Changelog](https://github.com/fog/fog-aws/compare/v3.24.0...v3.25.0)
13
+ - Update SES to use AWS SigV4 [\#727](https://github.com/fog/fog-aws/pull/727) ([ohookins](https://github.com/ohookins))
14
14
 
15
- **Closed issues:**
15
+ ## [v3.27.0](https://github.com/fog/fog-aws/tree/v3.27.0) (2024-09-16)
16
16
 
17
- - gsub exception from normalize\_headers with carrierwave [\#720](https://github.com/fog/fog-aws/issues/720)
18
- - Add AWS EKS Pod Identity support [\#718](https://github.com/fog/fog-aws/issues/718)
17
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.26.0...v3.27.0)
19
18
 
20
19
  **Merged pull requests:**
21
20
 
22
- - only try to gsub etag on files if there is one closes \#720 [\#722](https://github.com/fog/fog-aws/pull/722) ([geemus](https://github.com/geemus))
23
- - Added support for EKS Pod Identity. [\#721](https://github.com/fog/fog-aws/pull/721) ([y-sugawara-acs](https://github.com/y-sugawara-acs))
24
- - Disable S3 Signature v4 Streaming by default [\#719](https://github.com/fog/fog-aws/pull/719) ([stanhu](https://github.com/stanhu))
25
- - Drop warning if region is not us-east-1 in mock [\#717](https://github.com/fog/fog-aws/pull/717) ([stanhu](https://github.com/stanhu))
26
- - add base64 require and dependency [\#716](https://github.com/fog/fog-aws/pull/716) ([geemus](https://github.com/geemus))
21
+ - avoid merging connection value from headers when saving files [\#725](https://github.com/fog/fog-aws/pull/725) ([geemus](https://github.com/geemus))
27
22
 
28
- ## [v3.24.0](https://github.com/fog/fog-aws/tree/v3.24.0) (2024-07-08)
29
-
30
- [Full Changelog](https://github.com/fog/fog-aws/compare/v3.23.0...v3.24.0)
31
-
32
- **Closed issues:**
23
+ ## [v3.26.0](https://github.com/fog/fog-aws/tree/v3.26.0) (2024-09-10)
33
24
 
34
- - Fog.mock! not working with Storage provider [\#713](https://github.com/fog/fog-aws/issues/713)
25
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.25.0...v3.26.0)
35
26
 
36
27
  **Merged pull requests:**
37
28
 
38
- - Prefer AWS\_REGION over AWS\_DEFAULT\_REGION in credential fetching [\#715](https://github.com/fog/fog-aws/pull/715) ([stanhu](https://github.com/stanhu))
39
- - Provide a 'Changelog' link on rubygems.org/gems/fog-aws [\#714](https://github.com/fog/fog-aws/pull/714) ([mark-young-atg](https://github.com/mark-young-atg))
29
+ - Support AWS\_ENDPOINT\_URL\_STS environment variable [\#724](https://github.com/fog/fog-aws/pull/724) ([stanhu](https://github.com/stanhu))
40
30
 
41
31
 
42
32
 
@@ -281,7 +281,7 @@ module Fog
281
281
  merge_attributes(data.body)
282
282
  else
283
283
  data = service.put_object(directory.key, key, body, options)
284
- merge_attributes(data.headers.reject {|key, value| ['Content-Length', 'Content-Type'].include?(key)})
284
+ merge_attributes(data.headers.reject {|key, value| ['Connection', 'Content-Length', 'Content-Type'].include?(key)})
285
285
  end
286
286
  self.etag = self.etag.gsub('"','') if self.etag
287
287
  self.content_length = Fog::Storage.get_body_size(body)
data/lib/fog/aws/ses.rb CHANGED
@@ -48,18 +48,21 @@ module Fog
48
48
  def initialize(options={})
49
49
 
50
50
  @use_iam_profile = options[:use_iam_profile]
51
- setup_credentials(options)
52
51
 
53
52
  @instrumentor = options[:instrumentor]
54
53
  @instrumentor_name = options[:instrumentor_name] || 'fog.aws.ses'
55
54
  @connection_options = options[:connection_options] || {}
56
55
  options[:region] ||= 'us-east-1'
56
+ @region = options[:region]
57
+
57
58
  @host = options[:host] || "email.#{options[:region]}.amazonaws.com"
58
59
  @path = options[:path] || '/'
59
60
  @persistent = options[:persistent] || false
60
61
  @port = options[:port] || 443
61
62
  @scheme = options[:scheme] || 'https'
62
63
  @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
64
+
65
+ setup_credentials(options)
63
66
  end
64
67
 
65
68
  def reload
@@ -74,7 +77,7 @@ module Fog
74
77
  @aws_session_token = options[:aws_session_token]
75
78
  @aws_credentials_expire_at = options[:aws_credentials_expire_at]
76
79
 
77
- @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
80
+ @signer = Fog::AWS::SignatureV4.new(@aws_access_key_id, @aws_secret_access_key, @region, 'ses')
78
81
  end
79
82
 
80
83
  def request(params)
@@ -87,20 +90,20 @@ module Fog
87
90
  'Content-Type' => 'application/x-www-form-urlencoded',
88
91
  'Date' => Fog::Time.now.to_date_header,
89
92
  }
90
- headers['x-amz-security-token'] = @aws_session_token if @aws_session_token
91
- #AWS3-HTTPS AWSAccessKeyId=<Your AWS Access Key ID>, Algorithm=HmacSHA256, Signature=<Signature>
92
- headers['X-Amzn-Authorization'] = 'AWS3-HTTPS '
93
- headers['X-Amzn-Authorization'] << 'AWSAccessKeyId=' << @aws_access_key_id
94
- headers['X-Amzn-Authorization'] << ', Algorithm=HmacSHA256'
95
- headers['X-Amzn-Authorization'] << ', Signature=' << Base64.encode64(@hmac.sign(headers['Date'])).chomp!
96
-
97
- body = ''
98
- for key in params.keys.sort
99
- unless (value = params[key]).nil?
100
- body << "#{key}=#{CGI.escape(value.to_s).gsub(/\+/, '%20')}&"
101
- end
102
- end
103
- body.chop! # remove trailing '&'
93
+
94
+ body, headers = AWS.signed_params_v4(
95
+ params,
96
+ { 'Content-Type' => 'application/x-www-form-urlencoded' },
97
+ {
98
+ :method => 'POST',
99
+ :aws_session_token => @aws_session_token,
100
+ :signer => @signer,
101
+ :host => @host,
102
+ :path => @path,
103
+ :port => @port,
104
+ :version => '2010-12-01'
105
+ }
106
+ )
104
107
 
105
108
  if @instrumentor
106
109
  @instrumentor.instrument("#{@instrumentor_name}.request", params) do
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "3.26.0"
3
+ VERSION = '3.28.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.26.0
4
+ version: 3.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-09-10 00:00:00.000000000 Z
12
+ date: 2024-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler