codeclimate-kafka 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cc/kafka/producer/http.rb +11 -7
- data/lib/cc/kafka/version.rb +1 -1
- data/lib/cc/kafka.rb +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6342040b86ab69ae63452bf69bd757cf1ed9eb84
|
4
|
+
data.tar.gz: 9baba0293728b2935925add35dade45019c0287d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb387152b82a3281fb94020d16904503cb38456bfd409c489c3c6f8ec409b2f8540e77df7b714070040f98c97a47ed15386e085a7ae915390c6254bda128c130
|
7
|
+
data.tar.gz: ebadd12e34eec8f23ca262605dbfaecb87742b18caf35cb46cf599ae59cfd415f46145d13d88c7103aa73c7bb0bcc9b44c1ce39ce3ab3107f0820d442ce61363
|
@@ -21,7 +21,7 @@ module CC
|
|
21
21
|
if ssl?
|
22
22
|
http.use_ssl = true
|
23
23
|
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
24
|
-
http
|
24
|
+
add_ssl_certificates(http)
|
25
25
|
end
|
26
26
|
|
27
27
|
request = Net::HTTP::Post.new("/")
|
@@ -46,13 +46,17 @@ module CC
|
|
46
46
|
@ssl
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
50
|
-
|
51
|
-
|
49
|
+
def add_ssl_certificates(http)
|
50
|
+
if Kafka.ssl_ca_file
|
51
|
+
Kafka.logger.debug("CA certificate: #{Kafka.ssl_ca_file}")
|
52
|
+
http.ca_file = Kafka.ssl_ca_file
|
53
|
+
end
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
if Kafka.ssl_pem_file
|
56
|
+
Kafka.logger.debug("PEM certificate: #{Kafka.ssl_pem_file}")
|
57
|
+
pem = File.read(Kafka.ssl_pem_file)
|
58
|
+
http.cert = OpenSSL::X509::Certificate.new(pem)
|
59
|
+
http.key = OpenSSL::PKey::RSA.new(pem)
|
56
60
|
end
|
57
61
|
end
|
58
62
|
end
|
data/lib/cc/kafka/version.rb
CHANGED
data/lib/cc/kafka.rb
CHANGED
@@ -13,6 +13,8 @@ module CC
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class << self
|
16
|
+
attr_accessor :ssl_ca_file, :ssl_pem_file
|
17
|
+
|
16
18
|
attr_writer :offset_model, :logger, :statsd
|
17
19
|
|
18
20
|
def logger
|
@@ -30,10 +32,6 @@ module CC
|
|
30
32
|
def statsd
|
31
33
|
@statsd ||= DummyStatsd.new
|
32
34
|
end
|
33
|
-
|
34
|
-
def ssl_certificates
|
35
|
-
@ssl_certificates ||= []
|
36
|
-
end
|
37
35
|
end
|
38
36
|
end
|
39
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate-kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bson
|