aws-sdk-sns 1.0.0.rc11 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-sns.rb +1 -1
- data/lib/aws-sdk-sns/client.rb +1 -1
- data/lib/aws-sdk-sns/message_verifier.rb +14 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08b7f548dc1ca7798b9e6cdd700a6ba3ed67626e
|
4
|
+
data.tar.gz: 6f53dfe2e123d1252e0f4b17639af166e26a729a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0b93829aa033c346b34fa178f3fcee51cb417c0491b684c8f1841bf51466c944514405256de02c727320e093f8cafa84e55de341549ebcf1ec9128547827f5a
|
7
|
+
data.tar.gz: e347f85c8ce0c3e1dbdd400dbfd673888f8176a031102568a9279d99b51a8a985767bdd3dcfffa18c14d1ba601f434bb963ccb7ad560de708fa360c5dc22cff0
|
data/lib/aws-sdk-sns.rb
CHANGED
data/lib/aws-sdk-sns/client.rb
CHANGED
@@ -1592,7 +1592,7 @@ module Aws::SNS
|
|
1592
1592
|
params: params,
|
1593
1593
|
config: config)
|
1594
1594
|
context[:gem_name] = 'aws-sdk-sns'
|
1595
|
-
context[:gem_version] = '1.0.0
|
1595
|
+
context[:gem_version] = '1.0.0'
|
1596
1596
|
Seahorse::Client::Request.new(handlers, context)
|
1597
1597
|
end
|
1598
1598
|
|
@@ -59,6 +59,7 @@ module Aws
|
|
59
59
|
# verification.
|
60
60
|
def authenticate!(message_body)
|
61
61
|
msg = Json.load(message_body)
|
62
|
+
msg = convert_lambda_msg(msg) if is_from_lambda(msg)
|
62
63
|
if public_key(msg).verify(sha1, signature(msg), canonical_string(msg))
|
63
64
|
true
|
64
65
|
else
|
@@ -69,6 +70,19 @@ module Aws
|
|
69
70
|
|
70
71
|
private
|
71
72
|
|
73
|
+
def is_from_lambda(message)
|
74
|
+
message.key? 'SigningCertUrl'
|
75
|
+
end
|
76
|
+
|
77
|
+
def convert_lambda_msg(message)
|
78
|
+
cert_url = message.delete('SigningCertUrl')
|
79
|
+
unsubscribe_url = message.delete('UnsubscribeUrl')
|
80
|
+
|
81
|
+
message['SigningCertURL'] = cert_url
|
82
|
+
message['UnsubscribeURL'] = unsubscribe_url
|
83
|
+
message
|
84
|
+
end
|
85
|
+
|
72
86
|
def sha1
|
73
87
|
OpenSSL::Digest::SHA1.new
|
74
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-sns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.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: 2017-08-
|
11
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3
|
19
|
+
version: '3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3
|
26
|
+
version: '3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aws-sigv4
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,9 +73,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- - "
|
76
|
+
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
78
|
+
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
81
|
rubygems_version: 2.5.1
|