kerio-api 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 6c00b46bb329ab2417b663b65cd8176334dfcf0d
4
- data.tar.gz: 7df4debe629b14817e072d820c502db6a5e735e1
3
+ metadata.gz: 1f33843055272aaabc1ddbaa0528b64cc375815a
4
+ data.tar.gz: 3ca7ed5d050f30fad86d41ee4b17c2499683f81f
5
5
  SHA512:
6
- metadata.gz: 1c86955f1d57268c937b42af9ab258fc344151d434b2bc6abffa23548fdcd8997502598eca9ce6f5831ac21302680ba95895637a798dbcf129b690a26fcc2cb4
7
- data.tar.gz: a0fec7713219c1c62d5f02ba312b291e0b13345a86def168965db92bd5fc8412977a9b273fcb8e47046309817cf4f2831f53284f4f418ab13095bbb525494589
6
+ metadata.gz: 7b28b48ac50dc786cd61d4dbfe1755811980a078d06cf20d684fe979d08e9a083ef26527500f1de3610ea90ab5ad0e9ce7f0b47af7897a2331570e72f03bf379
7
+ data.tar.gz: bb3daf474faca0629831d297c50d78469a34027cdb2a1a5a76c8be2501b47cb3b826aa4255284d3b9afe5f0d99d90f3c0f60afe46f34b366274131053f0a5d32
@@ -8,7 +8,11 @@ module Kerio
8
8
  include Kerio::Api::ChainableMethod
9
9
 
10
10
  def initialize (params)
11
- @session = Kerio::Api::Session.new(params[:url])
11
+
12
+ verify_ssl = true
13
+ verify_ssl = !params[:insecure] if not params[:insecure].nil?
14
+
15
+ @session = Kerio::Api::Session.new(params[:url], verify_ssl)
12
16
  end
13
17
 
14
18
  def method_missing(method, *args, &block)
@@ -9,9 +9,10 @@ module Kerio
9
9
  class Session
10
10
  attr_writer :token
11
11
 
12
- def initialize(url)
12
+ def initialize(url, verify_ssl)
13
13
  @url = url
14
14
 
15
+ @verify_ssl = verify_ssl
15
16
  @token = nil
16
17
  @cookie = nil
17
18
  end
@@ -47,7 +48,7 @@ module Kerio
47
48
  @url.to_s,
48
49
  body: JSON.generate(body),
49
50
  headers: h,
50
- verify: false,
51
+ verify: @verify_ssl,
51
52
  follow_redirects: true,
52
53
  )
53
54
 
@@ -63,10 +64,11 @@ module Kerio
63
64
  resp = HTTMultiParty.post(
64
65
  @url.to_s + '/upload',
65
66
  headers: h,
66
- verify: false,
67
+ verify: @verify_ssl,
67
68
  query: {
68
69
  'newFile.bin' => file,
69
- }
70
+ },
71
+ follow_redirects: true,
70
72
  )
71
73
 
72
74
  process_json_response(resp)
@@ -82,8 +84,9 @@ module Kerio
82
84
  resp = HTTParty.get(
83
85
  u.to_s,
84
86
  headers: h,
85
- verify: false,
87
+ verify: @verify_ssl,
86
88
  stream_body: true,
89
+ follow_redirects: true,
87
90
  ) do |fragment|
88
91
  yield fragment
89
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kerio-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Baloun