istox 0.1.157.11.t3 → 0.1.157.11.t4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4282ef0f35cbc41d434a4091c8d2290d07b7c02b9f0c1203e4bb353404661847
4
- data.tar.gz: 7f4facd50bc4565d655bdb9992a75be5efd3f02352e8230dd6c46ace27990bea
3
+ metadata.gz: 96e4c1d66416166966ff6ce9dfc4a23fe6cd2d69625b767caec16b8f0e31d6f9
4
+ data.tar.gz: 7847d3d004d19e99be35807cb19995e6d7894eea4c435905a4238cb2da02030f
5
5
  SHA512:
6
- metadata.gz: 9af15c57ca57403f096db70bb01ea88d110044611d51f73f40ee3c18fc5793e265b63295a5fbe7315976ed3a8e16327edcbd348c341d69c71fadf8ecea684151
7
- data.tar.gz: 7167181aa5194f62989970c4a656928fd8de6532bd2002965c4c7e6a4172cdb577e6b66e240f19238a9a716300e59294dec74ad8687ef689feaa7e7d2e97af0b
6
+ metadata.gz: ada2bef07af903c7e7e1182ffebd6344b7b52a14bedffec316e462caed04041f2ef108e929f1e470b83e01b0789351b39c19352fd730b0de964636566e725e90
7
+ data.tar.gz: 5c57b6369afebbba64a9289fc2b9b9b08ca4d9fa4b906fef101d8f2e49350a51bbb2f0c09c8ea9b2a4a20593aa8e3d61838df5411b10153384429d3fe6ab7884
@@ -3,9 +3,11 @@ require 'istox/helpers/logger'
3
3
  module Istox
4
4
  class GrpcClient
5
5
  class << self
6
- def add_host(host_type, url)
6
+ def add_host(host_type, url, ssl_certificate = nil)
7
7
  @@hosts = {} unless defined?(@@hosts)
8
+ @@ssl_certs = {} unless defined?(@@ssl_certs)
8
9
 
10
+ @@ssl_certs[host_type] = ssl_certificate unless ssl_certificate.nil? || ssl_certificate.empty?
9
11
  @@hosts[host_type] = url
10
12
  end
11
13
 
@@ -83,9 +85,9 @@ module Istox
83
85
  log.info 'Reinitiating to grpc host at ' + host_url
84
86
  t1 = Time.now
85
87
  grpc_options = { hostname: host_url }
86
- if ENV.fetch('GRPC_SSL_CERTIFICATE', false)
88
+ if @@ssl_certs[host_type]
87
89
  log.info '[INFO] Using SSL connection...'
88
- grpc_options[:ssl_certificate] = ENV['GRPC_SSL_CERTIFICATE']
90
+ grpc_options[:ssl_certificate] = @@ssl_certs[host_type]
89
91
  end
90
92
  @@services[get_key(host_type, service)] = ::Gruf::Client.new(service: service, options: grpc_options, client_options: client_options)
91
93
  log.info "Time taken for reinitiating grpc host: #{Time.now - t1} seconds"
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.157.11.t3'.freeze
2
+ VERSION = '0.1.157.11.t4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.157.11.t3
4
+ version: 0.1.157.11.t4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng