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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36de26ce146e7bf9d5f635f10da822a4ffdd314d
4
- data.tar.gz: b99eec657c2d1a4b17edc875928338cf10cf53ea
3
+ metadata.gz: 6342040b86ab69ae63452bf69bd757cf1ed9eb84
4
+ data.tar.gz: 9baba0293728b2935925add35dade45019c0287d
5
5
  SHA512:
6
- metadata.gz: b5e4001bce63347d16c9c233aeab9a5561b5590cbf868e074e54fa25a12deae66ae9bdae46951865923b0daa6652f81aeed21b4ac42c7465fe51826cd6bcfde2
7
- data.tar.gz: bb60ea4c9c81378d8debcd3782ef7e8efbee3bb590cf3ded5d803c828d14b5cfbfc8294cc33da7c0644db59fbc179a3a6292619668d3dfeba8cf05f87ccce13d
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.cert_store = certificate_store
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 certificate_store
50
- OpenSSL::X509::Store.new.tap do |store|
51
- store.set_default_paths
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
- Kafka.ssl_certificates.each do |file|
54
- store.add_file(file)
55
- end
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
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Kafka
3
- VERSION = "0.3.1"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
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.3.1
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-10 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bson