activecypher 0.6.1 → 0.6.2

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: 3901e0713d002b9c8061ffe4f3e7e8b85cceb4faf3216df23c91cab136654356
4
- data.tar.gz: ba8088d2981a28e99eca7e171553f94696c0ed940a51c4ba53fa03210dce3be8
3
+ metadata.gz: 8d9c41285d4f1a84779d72a479b329e6c397d4630473d369691456e35f4337fc
4
+ data.tar.gz: 1673192a6552da378dfd625114f8bc8eee8e973eb17583d802de8fcbcd609c70
5
5
  SHA512:
6
- metadata.gz: 1e0923e31a2d8a3bfea68047870de373ab012ecc90d6164bacd43f8c7a3af1f88ce4c9051b4e4d53ca541d738cefeb988da3e508995557d2c51277870a39da60
7
- data.tar.gz: 63126e6704aa13ce3094d6aafc5590eb3d9786a58d065590fb68d98b5234ed5f7d125147663928cc7baadab3da623b5aafc9432b8324a4957e11b131632e8bf8
6
+ metadata.gz: 6feecb3dbad832f8f8253f64b3ccb030d2fe99194824d57bf5087db7caee2e335a4e7a6b21646e7ba098250812f3b05d4a5c812b7d8b0cc5b8e93e23f1c56ebb
7
+ data.tar.gz: f389ab164a37e002523c55e050abc1bee7c20df6e5c6e11e311f2a5f6200a33d27ac4512f676f36eebd155ce2f71f21c87a08f9431f0fe641d1051f09aee21be
@@ -34,9 +34,22 @@ module ActiveCypher
34
34
  { scheme: 'none' }
35
35
  end
36
36
 
37
+ # Get SSL connection params
38
+ ssl_params = if config[:url]
39
+ resolver = ActiveCypher::ConnectionUrlResolver.new(config[:url])
40
+ resolver.ssl_connection_params
41
+ else
42
+ {
43
+ secure: config[:ssl] ? true : false,
44
+ verify_cert: config[:ssc] ? false : true
45
+ }
46
+ end
47
+
37
48
  @connection = Bolt::Connection.new(
38
49
  host, port, self,
39
- auth_token: auth, timeout_seconds: config.fetch(:timeout, 15)
50
+ auth_token: auth,
51
+ timeout_seconds: config.fetch(:timeout, 15),
52
+ **ssl_params
40
53
  )
41
54
  @connection.connect
42
55
  validate_connection
@@ -81,13 +81,15 @@ module ActiveCypher
81
81
  principal: config[:username],
82
82
  credentials: config[:password]
83
83
  }
84
+ # Get SSL connection params from resolver
85
+ ssl_params = resolver.ssl_connection_params
86
+
84
87
  ActiveCypher::Bolt::Driver.new(
85
88
  uri: uri,
86
89
  adapter: adapter,
87
90
  auth_token: auth_token,
88
91
  pool_size: pool_size,
89
- secure: config[:ssl] ? true : false,
90
- verify_cert: config[:ssc] ? false : true
92
+ **ssl_params
91
93
  )
92
94
  end
93
95
  end
@@ -62,6 +62,17 @@ module ActiveCypher
62
62
  }
63
63
  end
64
64
 
65
+ # Returns SSL/TLS connection parameters based on ssl/ssc flags
66
+ # @return [Hash] Connection parameters for SSL/TLS
67
+ def ssl_connection_params
68
+ return {} unless @parsed
69
+
70
+ {
71
+ secure: @parsed[:ssl] ? true : false,
72
+ verify_cert: @parsed[:ssc] ? false : true
73
+ }
74
+ end
75
+
65
76
  private
66
77
 
67
78
  def parse_url(url_string)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveCypher
4
- VERSION = '0.6.1'
4
+ VERSION = '0.6.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activecypher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih