sendgrid-ruby 6.3.5 → 6.3.6
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 +4 -4
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +6 -0
- data/lib/rack/sendgrid_webhook_verification.rb +2 -0
- data/lib/sendgrid/version.rb +1 -1
- data/spec/rack/sendgrid_webhook_verification_spec.rb +26 -0
- data/test/sendgrid/test_sendgrid-ruby.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa01e80d5c4628995eb1deeafc8dc22364917d5840e1906e3c6319c2b7a66224
|
4
|
+
data.tar.gz: 87a42bf375187c6a21fcc2432753ce96cb17c8b47f851c1d3800defc0ef9378f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2689e50ffdd1914c0e0212cbfe3ac6faeb6d4c199edae135c13c5324d8d4d0c5ab39f0b5dbc33d9673c4de20540aa173262a3abfc58b000143430080d5dd68c9
|
7
|
+
data.tar.gz: b0e843dad160781bf98a01b507a7a5d7bb5a6c607a554cffede4871e7b00ce2e529de438189d33743901db48599a4fcc1b420c972de97b2df4ed54bae61813f3
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
[2020-10-14] Version 6.3.6
|
5
|
+
--------------------------
|
6
|
+
**Library - Fix**
|
7
|
+
- [PR #440](https://github.com/sendgrid/sendgrid-ruby/pull/440): reading position of a request body. Thanks to [@snaka](https://github.com/snaka)!
|
8
|
+
|
9
|
+
|
4
10
|
[2020-09-28] Version 6.3.5
|
5
11
|
--------------------------
|
6
12
|
**Library - Fix**
|
data/lib/sendgrid/version.rb
CHANGED
@@ -112,5 +112,31 @@ unless RUBY_PLATFORM == 'java'
|
|
112
112
|
expect(status).to eq(403)
|
113
113
|
end
|
114
114
|
end
|
115
|
+
|
116
|
+
describe 'request body which passed to an app' do
|
117
|
+
before do
|
118
|
+
@payload = nil
|
119
|
+
@spy_app = lambda do |env|
|
120
|
+
@payload = Rack::Request.new(env).body
|
121
|
+
[200, { 'Content-Type' => 'text/plain' }, ['Hello']]
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
let(:middleware) { Rack::SendGridWebhookVerification.new(@spy_app, public_key, %r{/email}) }
|
126
|
+
|
127
|
+
it 'keeps orignal reading position' do
|
128
|
+
options = {
|
129
|
+
:input => Fixtures::EventWebhook::PAYLOAD,
|
130
|
+
'Content-Type' => "application/json"
|
131
|
+
}
|
132
|
+
options[SendGrid::EventWebhookHeader::SIGNATURE] = Fixtures::EventWebhook::SIGNATURE
|
133
|
+
options[SendGrid::EventWebhookHeader::TIMESTAMP] = Fixtures::EventWebhook::TIMESTAMP
|
134
|
+
request = Rack::MockRequest.env_for('/email', options)
|
135
|
+
status, headers, body = middleware.call(request)
|
136
|
+
expect(status).to eq(200)
|
137
|
+
expect(@payload).not_to be_nil
|
138
|
+
expect(@payload.pos).to be_zero
|
139
|
+
end
|
140
|
+
end
|
115
141
|
end
|
116
142
|
end
|
@@ -33,7 +33,7 @@ class TestAPI < MiniTest::Test
|
|
33
33
|
assert_equal(test_headers, sg.request_headers)
|
34
34
|
assert_equal('v3', sg.version)
|
35
35
|
assert_equal(subuser, sg.impersonate_subuser)
|
36
|
-
assert_equal('6.3.
|
36
|
+
assert_equal('6.3.6', SendGrid::VERSION)
|
37
37
|
assert_instance_of(SendGrid::Client, sg.client)
|
38
38
|
end
|
39
39
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendgrid-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.3.
|
4
|
+
version: 6.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elmer Thomas
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ruby_http_client
|