logstash-mixin-rabbitmq_connection 5.0.0-java → 6.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,4 @@
1
1
  V 170510165759Z 01 unknown /CN=localhost/O=server
2
2
  V 170510170001Z 02 unknown /CN=localhost/O=client
3
+ V 450505233839Z 05 unknown /CN=localhost, O=client
4
+ V 450505234253Z 06 unknown /CN=localhost, O=server
@@ -1 +1,3 @@
1
1
  V 170510165759Z 01 unknown /CN=localhost/O=server
2
+ V 170510170001Z 02 unknown /CN=localhost/O=client
3
+ V 450505233839Z 05 unknown /CN=localhost, O=client
@@ -10,7 +10,7 @@ private_key = $dir/private/cakey.pem
10
10
  serial = $dir/serial
11
11
 
12
12
  default_crl_days = 7
13
- default_days = 365
13
+ default_days = 10000
14
14
  default_md = sha256
15
15
 
16
16
  policy = testca_policy
@@ -1 +1 @@
1
- 03
1
+ 07
@@ -1 +1 @@
1
- 02
1
+ 06
@@ -1,6 +1,5 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/devutils/rspec/spec_helper"
3
- require "logstash/pipeline"
4
3
  require "logstash/plugin_mixins/rabbitmq_connection"
5
4
  require "stud/temporary"
6
5
 
@@ -14,12 +13,12 @@ end
14
13
 
15
14
  describe LogStash::PluginMixins::RabbitMQConnection do
16
15
  let(:klass) { TestPlugin }
16
+ let(:default_port) { 5672 }
17
17
  let(:host) { "localhost" }
18
- let(:port) { 5672 }
18
+ let(:port) { default_port }
19
19
  let(:rabbitmq_settings) {
20
20
  {
21
- "host" => host,
22
- "port" => port,
21
+ "host" => host
23
22
  }
24
23
  }
25
24
  let(:instance) {
@@ -27,6 +26,24 @@ describe LogStash::PluginMixins::RabbitMQConnection do
27
26
  }
28
27
  let(:hare_info) { instance.instance_variable_get(:@hare_info) }
29
28
 
29
+
30
+
31
+ shared_examples_for 'it sets the addresses correctly' do
32
+ let(:file) { Stud::Temporary.file }
33
+ let(:path) { file.path }
34
+
35
+ it "should set addresses to the expected value" do
36
+ host.each_with_index do |_, index|
37
+ puts(expected_values[index])
38
+ expect(instance.rabbitmq_settings[:addresses][index]).to eql(expected_values[index])
39
+ end
40
+ end
41
+
42
+ it "should insert the correct number of address entries" do
43
+ expect(instance.rabbitmq_settings[:addresses].length).to eql(host.count)
44
+ end
45
+ end
46
+
30
47
  describe "rabbitmq_settings" do
31
48
  let(:file) { Stud::Temporary.file }
32
49
  let(:path) { file.path }
@@ -59,31 +76,83 @@ describe LogStash::PluginMixins::RabbitMQConnection do
59
76
  expect(instance.rabbitmq_settings[:tls_certificate_password]).to eql(rabbitmq_settings["ssl_certificate_password"])
60
77
  end
61
78
 
62
- it "should set hosts to the expected value " do
63
- expect(instance.rabbitmq_settings[:hosts][0]).to eql(host)
79
+ context 'with host names' do
80
+ let (:host) {%w(localhost rmq.elastic.co rmq.local)}
81
+ let (:expected_values) {%w(localhost:5672 rmq.elastic.co:5672 rmq.local:5672)}
82
+
83
+ it_behaves_like 'it sets the addresses correctly'
64
84
  end
65
85
 
66
- it "should only insert a single host entry" do
67
- expect(instance.rabbitmq_settings[:hosts].length).to eql(1)
86
+ context 'with host names including ports' do
87
+ let (:host) {%w(localhost:123 rmq.elastic.co:234 rmq.local:345)}
88
+ let (:expected_values) {%w(localhost:123 rmq.elastic.co:234 rmq.local:345)}
89
+
90
+ it_behaves_like 'it sets the addresses correctly'
68
91
  end
69
- end
70
92
 
71
- describe "rabbitmq_settings multiple hosts" do
72
- let(:file) { Stud::Temporary.file }
73
- let(:path) { file.path }
74
- after { File.unlink(path)}
93
+ context 'with ipv4 ip addresses' do
94
+ let (:host) {%w(127.0.0.1 192.168.1.1 192.168.1.2)}
95
+ let (:expected_values) {%w(127.0.0.1:5672 192.168.1.1:5672 192.168.1.2:5672)}
75
96
 
76
- let(:rabbitmq_settings) { super.merge({"host" => ["host01", "host02", "host03"]}) }
97
+ it_behaves_like 'it sets the addresses correctly'
98
+ end
77
99
 
78
- it "should set hosts to the expected value" do
79
- expect(instance.rabbitmq_settings[:hosts][0]).to eql("host01")
80
- expect(instance.rabbitmq_settings[:hosts][1]).to eql("host02")
81
- expect(instance.rabbitmq_settings[:hosts][2]).to eql("host03")
100
+ context 'with ipv4 ip addresses including ports' do
101
+ let (:host) {%w(127.0.0.1:123 192.168.1.1:234 192.168.1.2:345)}
102
+ let (:expected_values) {host}
103
+
104
+ it_behaves_like 'it sets the addresses correctly'
82
105
  end
83
106
 
84
- it "should insert 3 host entries" do
85
- expect(instance.rabbitmq_settings[:hosts].length).to eql(3)
107
+ context 'with ipv6 addresses' do
108
+ let (:host) {%w(::1 fe80::1c86:a2e:4bec:4a9f%en0 2406:da00:ff00::36e1:f792 [::1] [fe80::1c86:a2e:4bec:4a9f%en0] [2406:da00:ff00::36e1:f792])}
109
+ let (:expected_values) {%w([::1]:5672 [fe80::1c86:a2e:4bec:4a9f%en0]:5672 [2406:da00:ff00::36e1:f792]:5672 [::1]:5672 [fe80::1c86:a2e:4bec:4a9f%en0]:5672 [2406:da00:ff00::36e1:f792]:5672)}
110
+ it_behaves_like 'it sets the addresses correctly'
86
111
  end
112
+
113
+ context 'with ipv6 addresses including ports' do
114
+ let (:host) {%w([::1]:456 [fe80::1c86:a2e:4bec:4a9f%en0]:457 [2406:da00:ff00::36e1:f792]:458)}
115
+ let (:expected_values) {%w([::1]:456 [fe80::1c86:a2e:4bec:4a9f%en0]:457 [2406:da00:ff00::36e1:f792]:458)}
116
+ it_behaves_like 'it sets the addresses correctly'
117
+ end
118
+
119
+ context 'with a custom port' do
120
+ let(:port) { 123 }
121
+ let(:rabbitmq_settings) { super.merge({"port" => port})}
122
+
123
+ context 'with hostnames' do
124
+ let (:host) {%w(localhost rmq.elastic.co rmq.local)}
125
+ let (:expected_values) {%w(localhost:123 rmq.elastic.co:123 rmq.local:123)}
126
+
127
+ it_behaves_like 'it sets the addresses correctly'
128
+ end
129
+
130
+
131
+ context 'with ipv4 ip addresses' do
132
+ let (:host) {%w(127.0.0.1 192.168.1.1 192.168.1.2)}
133
+ let (:expected_values) {%w(127.0.0.1:123 192.168.1.1:123 192.168.1.2:123)}
134
+
135
+ it_behaves_like 'it sets the addresses correctly'
136
+ end
137
+
138
+ context 'with ipv6 addresses' do
139
+ let (:host) {%w(::1 fe80::1c86:a2e:4bec:4a9f%en0 2406:da00:ff00::36e1:f792 [::1] [fe80::1c86:a2e:4bec:4a9f%en0] [2406:da00:ff00::36e1:f792])}
140
+ let (:expected_values) {%w([::1]:123 [fe80::1c86:a2e:4bec:4a9f%en0]:123 [2406:da00:ff00::36e1:f792]:123 [::1]:123 [fe80::1c86:a2e:4bec:4a9f%en0]:123 [2406:da00:ff00::36e1:f792]:123)}
141
+ it_behaves_like 'it sets the addresses correctly'
142
+ end
143
+ end
144
+ end
145
+
146
+ describe "ssl enabled, but no verification" do
147
+ let(:rabbitmq_settings) { super.merge({"connection_timeout" => 123,
148
+ "heartbeat" => 456,
149
+ "ssl" => true}) }
150
+
151
+ it "should not have any certificates set" do
152
+ expect(instance.rabbitmq_settings[:tls_certificate_password]).to be nil
153
+ expect(instance.rabbitmq_settings[:tls_certificate_path]).to be nil
154
+ end
155
+
87
156
  end
88
157
 
89
158
  context "when connected" do
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-mixin-rabbitmq_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-02 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 3.0.0
18
+ version: '4.0'
19
19
  name: march_hare
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -80,28 +80,35 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
83
+ description: This gem is a Logstash plugin required to be installed on top of the
84
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
85
+ gem is not a stand-alone program
84
86
  email: info@elastic.co
85
87
  executables: []
86
88
  extensions: []
87
89
  extra_rdoc_files: []
88
90
  files:
91
+ - ".ci/docker-compose.yml"
92
+ - ".ci/run.sh"
89
93
  - ".github/CONTRIBUTING.md"
90
94
  - ".github/ISSUE_TEMPLATE.md"
91
95
  - ".github/PULL_REQUEST_TEMPLATE.md"
92
96
  - ".gitignore"
93
97
  - ".travis.yml"
94
- - CHANGELOG
98
+ - CHANGELOG.md
95
99
  - Gemfile
96
100
  - README.md
97
101
  - Rakefile
98
102
  - lib/logstash/plugin_mixins/rabbitmq_connection.rb
99
103
  - logstash-mixin-rabbitmq_connection.gemspec
104
+ - spec/fixtures/README.md
100
105
  - spec/fixtures/client/cert.pem
101
106
  - spec/fixtures/client/key.pem
102
107
  - spec/fixtures/client/keycert.p12
103
108
  - spec/fixtures/client/req.pem
104
- - spec/fixtures/password_for_files
109
+ - spec/fixtures/client_untrusted/cert.pem
110
+ - spec/fixtures/client_untrusted/key.pem
111
+ - spec/fixtures/client_untrusted/keycert.p12
105
112
  - spec/fixtures/server/cert.pem
106
113
  - spec/fixtures/server/key.pem
107
114
  - spec/fixtures/server/key_password
@@ -112,6 +119,8 @@ files:
112
119
  - spec/fixtures/testca/cacert.pem
113
120
  - spec/fixtures/testca/certs/01.pem
114
121
  - spec/fixtures/testca/certs/02.pem
122
+ - spec/fixtures/testca/certs/05.pem
123
+ - spec/fixtures/testca/certs/06.pem
115
124
  - spec/fixtures/testca/index.txt
116
125
  - spec/fixtures/testca/index.txt.attr
117
126
  - spec/fixtures/testca/index.txt.attr.old
@@ -133,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
142
  requirements:
134
143
  - - ">="
135
144
  - !ruby/object:Gem::Version
136
- version: '0'
145
+ version: 2.0.0
137
146
  required_rubygems_version: !ruby/object:Gem::Requirement
138
147
  requirements:
139
148
  - - ">="
@@ -141,16 +150,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
150
  version: '0'
142
151
  requirements: []
143
152
  rubyforge_project:
144
- rubygems_version: 2.4.8
153
+ rubygems_version: 2.6.13
145
154
  signing_key:
146
155
  specification_version: 4
147
156
  summary: Common functionality for RabbitMQ plugins
148
157
  test_files:
158
+ - spec/fixtures/README.md
149
159
  - spec/fixtures/client/cert.pem
150
160
  - spec/fixtures/client/key.pem
151
161
  - spec/fixtures/client/keycert.p12
152
162
  - spec/fixtures/client/req.pem
153
- - spec/fixtures/password_for_files
163
+ - spec/fixtures/client_untrusted/cert.pem
164
+ - spec/fixtures/client_untrusted/key.pem
165
+ - spec/fixtures/client_untrusted/keycert.p12
154
166
  - spec/fixtures/server/cert.pem
155
167
  - spec/fixtures/server/key.pem
156
168
  - spec/fixtures/server/key_password
@@ -161,6 +173,8 @@ test_files:
161
173
  - spec/fixtures/testca/cacert.pem
162
174
  - spec/fixtures/testca/certs/01.pem
163
175
  - spec/fixtures/testca/certs/02.pem
176
+ - spec/fixtures/testca/certs/05.pem
177
+ - spec/fixtures/testca/certs/06.pem
164
178
  - spec/fixtures/testca/index.txt
165
179
  - spec/fixtures/testca/index.txt.attr
166
180
  - spec/fixtures/testca/index.txt.attr.old
data/CHANGELOG DELETED
@@ -1,44 +0,0 @@
1
- * 5.0.0
2
- - Mark deprecated options `debug`, `tls_certificate_path` and `tls_certificate_password` as obsolete
3
-
4
- * 4.3.0
5
- - Bump march hare to 3.0.0
6
- * 4.2.2
7
- - Bump march hare to 2.22.0 to properly convert LongString to String
8
- * 4.2.1
9
- - Bump march_hare version to 2.20.0 to fix reconnection issues
10
- * 4.2.0
11
- - Include URL of server when logging errors
12
- - Add warning log when connection is severed
13
- * 4.1.3
14
- - Bump march_hare version to 2.19.0 to fix reconnection failures with
15
- proxies. See
16
- https://github.com/logstash-plugins/logstash-input-rabbitmq/issues/76 for
17
- more info
18
- * 4.1.2
19
- - Retry the connection attempt if there is an IO Exception.
20
- * 4.1.1
21
- - Remove internal Logstash deps that were not necessary
22
- * 4.1.0
23
- - Fix SSL option to be boolean once again
24
- - Add separate ssl_version parameter
25
- - Mark verify_ssl parameter as obsolete since it never worked
26
- - Better checks for SSL argument consistency
27
- * 2.4.0
28
- - Add SSL/TLS Support
29
- - Add support for "x-consistent-hash" and "x-modulus-hash" exchanges
30
- * 2.3.1
31
- - use logstash-core-plugin-api as dependency instead of logstash-core directly
32
- * 2.3.0
33
- - Bump march_mare version to 2.15.0 to fix perms issue internal to march hare gem (.jar not installed with o+r perms)
34
- * 2.2.0
35
- - Rollback the changes in 2.1.0 . prefetch_count only belongs in the input plugin
36
- * 2.1.0
37
- - Add prefetch_count config option
38
- * 2.0.3
39
- - Add heartbeat setting
40
- - Add connect_timeout setting
41
- * 2.0.0
42
- - Make LS2 compatible
43
- * 1.0.1
44
- - Initial Release
@@ -1 +0,0 @@
1
- MySecretPassword