logstash-input-jdbc 4.0.1 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e32e58893ccf6dccc61c104295f6650c4c54e0a
4
- data.tar.gz: b2a94b10eb6e6820d3f4820307a81e5e8116bc56
3
+ metadata.gz: afede6bb954e753352fe3138057cb32dbffc814d
4
+ data.tar.gz: 624feecfdfdea557f91b480acfccb7d0948a4660
5
5
  SHA512:
6
- metadata.gz: 1f504c333b1e161e837ddecea78115e22cd7097ef8ff9b567557eb50f204d797b5c7cb5cfe5da3815bb168737e1d937dee93e517a5705bc2b720bb66149ce69a
7
- data.tar.gz: 4c06af8468321c95732f23983d06dfe89a1fb5c1c591c0c5cbadca24dc1ae257f0a92f0327184ca4a6c1cbf956020ebe82a812019f3925df00ec9fe24f735d3a
6
+ metadata.gz: da164fbd6abf2627372925ff198ba99fd822588392365498f3543a928e1ffcdd297b3098ba30ac4d8426b06059f4c4fde8cbef4ef1f21652a9345298e27c641c
7
+ data.tar.gz: 4b6a2ede22c3392d6553cb2b04a7b1c26c5333722ffc7dc16ebe0fa19eee49dce7bdee9a773a4ce35aff55692942d7db06950ea571d72d37f94e165e66ea846a
@@ -1,3 +1,5 @@
1
+ ## 4.0.2
2
+ - Added feature to read password from external file (#120).
1
3
  ## 4.0.1
2
4
  - Republish all the gems under jruby.
3
5
  ## 4.0.0
data/README.md CHANGED
@@ -95,6 +95,7 @@ Reading data from MySQL:
95
95
  jdbc_connection_string => "jdbc:mysql://host:port/database"
96
96
  jdbc_user => "user"
97
97
  jdbc_password => "password"
98
+ # or jdbc_password_filepath => "/path/to/my/password_file"
98
99
  statement => "SELECT ..."
99
100
  jdbc_paging_enabled => "true"
100
101
  jdbc_page_size => "50000"
@@ -185,6 +185,12 @@ class LogStash::Inputs::Jdbc < LogStash::Inputs::Base
185
185
  end
186
186
 
187
187
  @statement = File.read(@statement_filepath) if @statement_filepath
188
+
189
+ if (@jdbc_password_filepath and @jdbc_password)
190
+ raise(LogStash::ConfigurationError, "Only one of :jdbc_password, :jdbc_password_filepath may be set at a time.")
191
+ end
192
+
193
+ @jdbc_password = File.read(@jdbc_password_filepath).strip if @jdbc_password_filepath
188
194
  end # def register
189
195
 
190
196
  def run(queue)
@@ -40,6 +40,9 @@ module LogStash::PluginMixins::Jdbc
40
40
  # JDBC password
41
41
  config :jdbc_password, :validate => :password
42
42
 
43
+ # JDBC password filename
44
+ config :jdbc_password_filepath, :validate => :path
45
+
43
46
  # JDBC enable paging
44
47
  #
45
48
  # This will cause a sql statement to be broken up into multiple queries.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-jdbc'
3
- s.version = '4.0.1'
3
+ s.version = '4.0.2'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "This example input streams a string at a definable interval."
6
6
  s.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"
@@ -81,6 +81,41 @@ describe LogStash::Inputs::Jdbc do
81
81
  end
82
82
  end
83
83
 
84
+ context "when both jdbc_password and jdbc_password_filepath arguments are passed" do
85
+ let(:statement) { "SELECT * from test_table" }
86
+ let(:jdbc_password) { "secret" }
87
+ let(:jdbc_password_file_path) { Stud::Temporary.pathname }
88
+ let(:settings) { { "jdbc_password_filepath" => jdbc_password_file_path,
89
+ "jdbc_password" => jdbc_password,
90
+ "statement" => statement } }
91
+
92
+ it "should fail to register" do
93
+ expect{ plugin.register }.to raise_error(LogStash::ConfigurationError)
94
+ end
95
+ end
96
+
97
+ context "when jdbc_password is passed in from a file" do
98
+ let(:statement) { "SELECT * from test_table" }
99
+ let(:jdbc_password) { "secret" }
100
+ let(:jdbc_password_file_path) { Stud::Temporary.pathname }
101
+ let(:settings) { { "jdbc_password_filepath" => jdbc_password_file_path,
102
+ "statement" => statement } }
103
+
104
+ before do
105
+ File.write(jdbc_password_file_path, jdbc_password)
106
+ plugin.register
107
+ end
108
+
109
+ after do
110
+ plugin.stop
111
+ end
112
+
113
+ it "should read in jdbc_password from file" do
114
+ expect(plugin.jdbc_password).to eq(jdbc_password)
115
+ end
116
+ end
117
+
118
+
84
119
  context "when neither statement and statement_filepath arguments are passed" do
85
120
  it "should fail to register" do
86
121
  expect{ plugin.register }.to raise_error(LogStash::ConfigurationError)
metadata CHANGED
@@ -1,155 +1,155 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core-plugin-api
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
14
20
  requirement: !ruby/object:Gem::Requirement
15
21
  requirements:
16
- - - "~>"
22
+ - - ~>
17
23
  - !ruby/object:Gem::Version
18
24
  version: '2.0'
19
- name: logstash-core-plugin-api
20
25
  prerelease: false
21
26
  type: :runtime
27
+ - !ruby/object:Gem::Dependency
28
+ name: logstash-codec-plain
22
29
  version_requirements: !ruby/object:Gem::Requirement
23
30
  requirements:
24
- - - "~>"
31
+ - - '>='
25
32
  - !ruby/object:Gem::Version
26
- version: '2.0'
27
- - !ruby/object:Gem::Dependency
33
+ version: '0'
28
34
  requirement: !ruby/object:Gem::Requirement
29
35
  requirements:
30
- - - ">="
36
+ - - '>='
31
37
  - !ruby/object:Gem::Version
32
38
  version: '0'
33
- name: logstash-codec-plain
34
39
  prerelease: false
35
40
  type: :runtime
41
+ - !ruby/object:Gem::Dependency
42
+ name: sequel
36
43
  version_requirements: !ruby/object:Gem::Requirement
37
44
  requirements:
38
- - - ">="
45
+ - - '>='
39
46
  - !ruby/object:Gem::Version
40
47
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
48
  requirement: !ruby/object:Gem::Requirement
43
49
  requirements:
44
- - - ">="
50
+ - - '>='
45
51
  - !ruby/object:Gem::Version
46
52
  version: '0'
47
- name: sequel
48
53
  prerelease: false
49
54
  type: :runtime
55
+ - !ruby/object:Gem::Dependency
56
+ name: tzinfo
50
57
  version_requirements: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ">="
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
62
  requirement: !ruby/object:Gem::Requirement
57
63
  requirements:
58
- - - ">="
64
+ - - '>='
59
65
  - !ruby/object:Gem::Version
60
66
  version: '0'
61
- name: tzinfo
62
67
  prerelease: false
63
68
  type: :runtime
69
+ - !ruby/object:Gem::Dependency
70
+ name: tzinfo-data
64
71
  version_requirements: !ruby/object:Gem::Requirement
65
72
  requirements:
66
- - - ">="
73
+ - - '>='
67
74
  - !ruby/object:Gem::Version
68
75
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
76
  requirement: !ruby/object:Gem::Requirement
71
77
  requirements:
72
- - - ">="
78
+ - - '>='
73
79
  - !ruby/object:Gem::Version
74
80
  version: '0'
75
- name: tzinfo-data
76
81
  prerelease: false
77
82
  type: :runtime
83
+ - !ruby/object:Gem::Dependency
84
+ name: rufus-scheduler
78
85
  version_requirements: !ruby/object:Gem::Requirement
79
86
  requirements:
80
- - - ">="
87
+ - - '>='
81
88
  - !ruby/object:Gem::Version
82
89
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
90
  requirement: !ruby/object:Gem::Requirement
85
91
  requirements:
86
- - - ">="
92
+ - - '>='
87
93
  - !ruby/object:Gem::Version
88
94
  version: '0'
89
- name: rufus-scheduler
90
95
  prerelease: false
91
96
  type: :runtime
97
+ - !ruby/object:Gem::Dependency
98
+ name: logstash-devutils
92
99
  version_requirements: !ruby/object:Gem::Requirement
93
100
  requirements:
94
- - - ">="
101
+ - - '>='
95
102
  - !ruby/object:Gem::Version
96
103
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
104
  requirement: !ruby/object:Gem::Requirement
99
105
  requirements:
100
- - - ">="
106
+ - - '>='
101
107
  - !ruby/object:Gem::Version
102
108
  version: '0'
103
- name: logstash-devutils
104
109
  prerelease: false
105
110
  type: :development
111
+ - !ruby/object:Gem::Dependency
112
+ name: timecop
106
113
  version_requirements: !ruby/object:Gem::Requirement
107
114
  requirements:
108
- - - ">="
115
+ - - '>='
109
116
  - !ruby/object:Gem::Version
110
117
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
118
  requirement: !ruby/object:Gem::Requirement
113
119
  requirements:
114
- - - ">="
120
+ - - '>='
115
121
  - !ruby/object:Gem::Version
116
122
  version: '0'
117
- name: timecop
118
123
  prerelease: false
119
124
  type: :development
125
+ - !ruby/object:Gem::Dependency
126
+ name: jdbc-derby
120
127
  version_requirements: !ruby/object:Gem::Requirement
121
128
  requirements:
122
- - - ">="
129
+ - - '>='
123
130
  - !ruby/object:Gem::Version
124
131
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
132
  requirement: !ruby/object:Gem::Requirement
127
133
  requirements:
128
- - - ">="
134
+ - - '>='
129
135
  - !ruby/object:Gem::Version
130
136
  version: '0'
131
- name: jdbc-derby
132
137
  prerelease: false
133
138
  type: :development
139
+ - !ruby/object:Gem::Dependency
140
+ name: docker-api
134
141
  version_requirements: !ruby/object:Gem::Requirement
135
142
  requirements:
136
- - - ">="
143
+ - - '>='
137
144
  - !ruby/object:Gem::Version
138
145
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
146
  requirement: !ruby/object:Gem::Requirement
141
147
  requirements:
142
- - - ">="
148
+ - - '>='
143
149
  - !ruby/object:Gem::Version
144
150
  version: '0'
145
- name: docker-api
146
151
  prerelease: false
147
152
  type: :development
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
153
  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
154
154
  email: info@elastic.co
155
155
  executables: []
@@ -177,12 +177,12 @@ require_paths:
177
177
  - lib
178
178
  required_ruby_version: !ruby/object:Gem::Requirement
179
179
  requirements:
180
- - - ">="
180
+ - - '>='
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - '>='
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  requirements: []