aws-ses 0.7.0 → 0.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05f8041ea9198a602f2ce4882d6e97cc02975836
4
- data.tar.gz: 751a555c98abe3962855fa0cc68e4048215e5c02
3
+ metadata.gz: 649f6d5775f0057147e1b411dd5f43af48812bf2
4
+ data.tar.gz: b3b7fd033599ef3678b3c93d0ed6f0456bcef2d5
5
5
  SHA512:
6
- metadata.gz: 2d42dc94c62bf6379c1f8bb4ebeb62203270a1b786bbed459138b6cb1912260822621f4ec753d3ad1c7c244a0d56e2b730f289c30a5a133dc41b34a5be75d2de
7
- data.tar.gz: 68b570b0043c013cd72858d0136840357b99f5110eacec9a09e7f1f30a008dbd65af8042d7b8d71fca5c454662e1becb941ef4c94b112112c0527fecebd47519
6
+ metadata.gz: d8e1a237725651f2e99fcc6a8207466df258b9ce466058ca13287a9f6e16f9fbd60fcb6690a54cbafe382131149180e2474e23dad3d02e56d6e261b7895f8bcb
7
+ data.tar.gz: 776c4d15557c85664f81dbcbd49caf401a48d4e21bc7beb01846688055da1b3d243e7ad1040e82742e9167d46f9d46b193359256a438c711b6f4659068462db4
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 0.7.1:
2
+ * Bugfix in sig version v4 detection
3
+
1
4
  0.7.0:
2
5
  * Implement Authorization Header v4 (add config: `signature_version: 4`)
3
6
  * Wrap message ID in `<>` correctly
data/README.erb CHANGED
@@ -20,7 +20,7 @@ This gem is compatible with Rails >= 3.0.0 and Ruby 2.3.x
20
20
 
21
21
  To use, first add the gem to your Gemfile:
22
22
 
23
- gem "aws-ses", "~> 0.7.0", :require => 'aws/ses'
23
+ gem "aws-ses", "~> 0.7.1", :require => 'aws/ses'
24
24
 
25
25
  == For Rails 3.x
26
26
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: aws-ses 0.7.0 ruby lib
5
+ # stub: aws-ses 0.7.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "aws-ses".freeze
9
- s.version = "0.7.0"
9
+ s.version = "0.7.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Drew Blas".freeze, "Marcel Molina Jr.".freeze]
14
- s.date = "2020-09-03"
14
+ s.date = "2020-09-30"
15
15
  s.description = "Client library for Amazon's Simple Email Service's REST API".freeze
16
16
  s.email = "drew.blas@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -177,7 +177,7 @@ module AWS #:nodoc:
177
177
 
178
178
  req = {}
179
179
 
180
- req['X-Amzn-Authorization'] = get_aws_auth_param(timestamp.httpdate, @secret_access_key, action, signature_version.to_s)
180
+ req['X-Amzn-Authorization'] = get_aws_auth_param(timestamp.httpdate, @secret_access_key, action, signature_version)
181
181
  req['Date'] = timestamp.httpdate
182
182
  req['User-Agent'] = @user_agent
183
183
 
@@ -195,10 +195,14 @@ module AWS #:nodoc:
195
195
 
196
196
  # Set the Authorization header using AWS signed header authentication
197
197
  def get_aws_auth_param(timestamp, secret_access_key, action = '', signature_version = 2)
198
+ raise(ArgumentError, "signature_version must be `2` or `4`") unless signature_version == 2 || signature_version == 4
198
199
  encoded_canonical = SES.encode(secret_access_key, timestamp, false)
199
- return SES.authorization_header(@access_key_id, 'HmacSHA256', encoded_canonical) unless signature_version == 4
200
200
 
201
- SES.authorization_header_v4(sig_v4_auth_credential, sig_v4_auth_signed_headers, sig_v4_auth_signature(action))
201
+ if signature_version == 4
202
+ SES.authorization_header_v4(sig_v4_auth_credential, sig_v4_auth_signed_headers, sig_v4_auth_signature(action))
203
+ else
204
+ SES.authorization_header(@access_key_id, 'HmacSHA256', encoded_canonical)
205
+ end
202
206
  end
203
207
 
204
208
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-ses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drew Blas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-09-03 00:00:00.000000000 Z
12
+ date: 2020-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder