postmark 1.19.1 → 1.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +16 -0
- data/lib/postmark/http_client.rb +6 -3
- data/lib/postmark/version.rb +1 -1
- data/spec/integration/api_client_resources_spec.rb +1 -0
- data/spec/unit/postmark/http_client_spec.rb +6 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45d3044b475c26b380a5af538b2041b23e5051d317fca3da4d06dbbd777a9b26
|
4
|
+
data.tar.gz: ad943ebef5f02830354c1351c820c1b89bf65d67a7a70f633976f5559b5f6667
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59ad96a4dc0292b451a2a31b1cf412a2bdd18e4bebcc477f8e52e7d6c8a429dc0caa99213294ec9a24b0aa17c4ce2a5e15e65c2ea4f158863b7a7769c4272df4
|
7
|
+
data.tar.gz: 788444b0afba94c35473b3db60f71febebae947753b658374933471ed9afc47dc0cacce2d4692225a27fcce88fbdf824b7a3dbe76551648cdc3519be75fac2cd
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
= Changelog
|
2
2
|
|
3
|
+
== 1.19.2
|
4
|
+
|
5
|
+
Allow possibility to change TLS version for HTTP client.
|
6
|
+
|
7
|
+
== 1.19.1
|
8
|
+
|
9
|
+
Bounce tags endoint removed, since it's no longer supported by API.
|
10
|
+
|
11
|
+
== 1.19.0
|
12
|
+
|
13
|
+
Webhooks management support is added.
|
14
|
+
|
15
|
+
== 1.18.0
|
16
|
+
|
17
|
+
Custom headers with any type of character casing is supported now.
|
18
|
+
|
3
19
|
== 1.17.0
|
4
20
|
|
5
21
|
* Update sent email message properly and not altering it's Message-ID with Postmark unique message id.
|
data/lib/postmark/http_client.rb
CHANGED
@@ -6,7 +6,9 @@ module Postmark
|
|
6
6
|
attr_accessor :api_token
|
7
7
|
attr_reader :http, :secure, :proxy_host, :proxy_port, :proxy_user,
|
8
8
|
:proxy_pass, :host, :port, :path_prefix,
|
9
|
-
:http_open_timeout, :http_read_timeout, :
|
9
|
+
:http_open_timeout, :http_read_timeout, :http_ssl_version,
|
10
|
+
:auth_header_name
|
11
|
+
|
10
12
|
alias_method :api_key, :api_token
|
11
13
|
alias_method :api_key=, :api_token=
|
12
14
|
|
@@ -16,7 +18,8 @@ module Postmark
|
|
16
18
|
:secure => true,
|
17
19
|
:path_prefix => '/',
|
18
20
|
:http_read_timeout => 15,
|
19
|
-
:http_open_timeout => 5
|
21
|
+
:http_open_timeout => 5,
|
22
|
+
:http_ssl_version => :TLSv1
|
20
23
|
}
|
21
24
|
|
22
25
|
def initialize(api_token, options = {})
|
@@ -100,7 +103,7 @@ module Postmark
|
|
100
103
|
http.read_timeout = self.http_read_timeout
|
101
104
|
http.open_timeout = self.http_open_timeout
|
102
105
|
http.use_ssl = !!self.secure
|
103
|
-
http.ssl_version =
|
106
|
+
http.ssl_version = self.http_ssl_version if http.respond_to?(:ssl_version=)
|
104
107
|
http
|
105
108
|
end
|
106
109
|
end
|
data/lib/postmark/version.rb
CHANGED
@@ -18,6 +18,7 @@ describe 'Accessing server resources using the API' do
|
|
18
18
|
let(:unique_token) {rand(36 ** 32).to_s(36)}
|
19
19
|
|
20
20
|
it 'can be used to manage tag triggers via the API' do
|
21
|
+
skip("Endpoint removed")
|
21
22
|
trigger = api_client.create_trigger(:tags, :match_name => "gemtest_#{unique_token}", :track_opens => true)
|
22
23
|
api_client.update_trigger(:tags, trigger[:id], :match_name => "pre_#{trigger[:match_name]}")
|
23
24
|
updated = api_client.get_trigger(:tags, trigger[:id])
|
@@ -29,6 +29,7 @@ describe Postmark::HttpClient do
|
|
29
29
|
it { expect(subject).to respond_to(:path_prefix) }
|
30
30
|
it { expect(subject).to respond_to(:http_open_timeout) }
|
31
31
|
it { expect(subject).to respond_to(:http_read_timeout) }
|
32
|
+
it { expect(subject).to respond_to(:http_ssl_version) }
|
32
33
|
end
|
33
34
|
|
34
35
|
context "when it is created without options" do
|
@@ -41,7 +42,7 @@ describe Postmark::HttpClient do
|
|
41
42
|
its(:http_read_timeout) { is_expected.to eq 15 }
|
42
43
|
its(:http_open_timeout) { is_expected.to eq 5 }
|
43
44
|
|
44
|
-
it '
|
45
|
+
it 'use default TLS encryption', :skip_ruby_version => ['1.8.7'] do
|
45
46
|
http_client = subject.http
|
46
47
|
expect(http_client.ssl_version).to eq :TLSv1
|
47
48
|
end
|
@@ -58,6 +59,7 @@ describe Postmark::HttpClient do
|
|
58
59
|
let(:path_prefix) { "/provided/path/prefix" }
|
59
60
|
let(:http_open_timeout) { 42 }
|
60
61
|
let(:http_read_timeout) { 42 }
|
62
|
+
let(:http_ssl_version) { :TLSv1_2}
|
61
63
|
|
62
64
|
subject { Postmark::HttpClient.new(api_token,
|
63
65
|
:secure => secure,
|
@@ -69,7 +71,8 @@ describe Postmark::HttpClient do
|
|
69
71
|
:port => port,
|
70
72
|
:path_prefix => path_prefix,
|
71
73
|
:http_open_timeout => http_open_timeout,
|
72
|
-
:http_read_timeout => http_read_timeout
|
74
|
+
:http_read_timeout => http_read_timeout,
|
75
|
+
:http_ssl_version => http_ssl_version) }
|
73
76
|
|
74
77
|
its(:api_token) { is_expected.to eq api_token }
|
75
78
|
its(:api_key) { is_expected.to eq api_token }
|
@@ -83,6 +86,7 @@ describe Postmark::HttpClient do
|
|
83
86
|
its(:path_prefix) { is_expected.to eq path_prefix }
|
84
87
|
its(:http_open_timeout) { is_expected.to eq http_open_timeout }
|
85
88
|
its(:http_read_timeout) { is_expected.to eq http_read_timeout }
|
89
|
+
its(:http_ssl_version) { is_expected.to eq http_ssl_version }
|
86
90
|
|
87
91
|
it 'uses port 80 for plain HTTP connections' do
|
88
92
|
expect(Postmark::HttpClient.new(api_token, :secure => false).port).to eq(80)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.19.
|
4
|
+
version: 1.19.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petyo Ivanov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: 1.3.7
|
148
148
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.1.2
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Official Postmark API wrapper.
|