fluent-plugin-ssl-check 1.0.0 → 1.1.0
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 +5 -0
- data/Gemfile.lock +1 -1
- data/fluent-plugin-ssl-check.gemspec +1 -1
- data/lib/fluent/plugin/extensions/time.rb +4 -1
- data/lib/fluent/plugin/in_ssl_check.rb +10 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acb92c3a49bddffabb4e0c3a18903f4d1e4ebabb0a4bde9e4822fd4726c86bc7
|
4
|
+
data.tar.gz: a4490494cc312a493be34012b70ec1f0d584bc3461d969f7b4c22711a1f57727
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c7eb0483748e41e824eceb5cdbeae2e6ec911b5ced44f3b3748bec530f095eee01a9ee2028731d6b80d2c7cedd2b57b831b7fc77ac2abc89c761a8bebe41aa8
|
7
|
+
data.tar.gz: 0b50f77e08b75158651b553f18c9acb1497bf4ced4d0b95862fd1f034fb67fa10b4df5cd261b1c2f15bdde2d3d300ff5712182b89115a2b897124910bcebedc1
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -69,7 +69,7 @@ module Fluent
|
|
69
69
|
|
70
70
|
helpers :timer
|
71
71
|
|
72
|
-
# rubocop:disable Metrics/
|
72
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
73
73
|
def configure(conf)
|
74
74
|
super
|
75
75
|
|
@@ -86,7 +86,7 @@ module Fluent
|
|
86
86
|
timeout: timeout
|
87
87
|
)
|
88
88
|
end
|
89
|
-
# rubocop:enable Metrics/
|
89
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
90
90
|
|
91
91
|
def start
|
92
92
|
super
|
@@ -116,6 +116,7 @@ module Fluent
|
|
116
116
|
'ssl_not_after' => ssl_info.not_after,
|
117
117
|
'expire_in_days' => ssl_info.expire_in_days
|
118
118
|
}
|
119
|
+
record.update('error_class' => ssl_info.error_class) if ssl_info.error_class
|
119
120
|
router.emit(tag, Fluent::EventTime.from_time(ssl_info.time), record)
|
120
121
|
end
|
121
122
|
|
@@ -124,7 +125,6 @@ module Fluent
|
|
124
125
|
emit_metric_expirency(ssl_info)
|
125
126
|
end
|
126
127
|
|
127
|
-
# rubocop:disable Metrics/AbcSize
|
128
128
|
def emit_metric_status(ssl_info)
|
129
129
|
record = {
|
130
130
|
'timestamp' => ssl_info.time.send("to_#{timestamp_format}"),
|
@@ -138,7 +138,6 @@ module Fluent
|
|
138
138
|
}
|
139
139
|
router.emit(tag, Fluent::EventTime.from_time(ssl_info.time), record)
|
140
140
|
end
|
141
|
-
# rubocop:enable Metrics/AbcSize
|
142
141
|
|
143
142
|
def emit_metric_expirency(ssl_info)
|
144
143
|
return if ssl_info.error
|
@@ -193,6 +192,12 @@ module Fluent
|
|
193
192
|
|
194
193
|
OK
|
195
194
|
end
|
195
|
+
|
196
|
+
def error_class
|
197
|
+
return unless error
|
198
|
+
|
199
|
+
error.class.to_s
|
200
|
+
end
|
196
201
|
end
|
197
202
|
|
198
203
|
# ssl client
|
@@ -208,7 +213,6 @@ module Fluent
|
|
208
213
|
@timeout = timeout
|
209
214
|
end
|
210
215
|
|
211
|
-
# rubocop:disable Metrics/AbcSize
|
212
216
|
def ssl_info
|
213
217
|
info = SslInfo.new
|
214
218
|
begin
|
@@ -225,11 +229,10 @@ module Fluent
|
|
225
229
|
info.ssl_version = ssl_socket.ssl_version
|
226
230
|
end
|
227
231
|
rescue StandardError => e
|
228
|
-
info.error = e
|
232
|
+
info.error = e
|
229
233
|
end
|
230
234
|
info
|
231
235
|
end
|
232
|
-
# rubocop:enable Metrics/AbcSize
|
233
236
|
|
234
237
|
def store
|
235
238
|
OpenSSL::X509::Store.new.tap do |store|
|