kerio-api 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kerio-api/client.rb +5 -1
- data/lib/kerio-api/session.rb +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f33843055272aaabc1ddbaa0528b64cc375815a
|
4
|
+
data.tar.gz: 3ca7ed5d050f30fad86d41ee4b17c2499683f81f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b28b48ac50dc786cd61d4dbfe1755811980a078d06cf20d684fe979d08e9a083ef26527500f1de3610ea90ab5ad0e9ce7f0b47af7897a2331570e72f03bf379
|
7
|
+
data.tar.gz: bb3daf474faca0629831d297c50d78469a34027cdb2a1a5a76c8be2501b47cb3b826aa4255284d3b9afe5f0d99d90f3c0f60afe46f34b366274131053f0a5d32
|
data/lib/kerio-api/client.rb
CHANGED
@@ -8,7 +8,11 @@ module Kerio
|
|
8
8
|
include Kerio::Api::ChainableMethod
|
9
9
|
|
10
10
|
def initialize (params)
|
11
|
-
|
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)
|
data/lib/kerio-api/session.rb
CHANGED
@@ -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:
|
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:
|
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:
|
87
|
+
verify: @verify_ssl,
|
86
88
|
stream_body: true,
|
89
|
+
follow_redirects: true,
|
87
90
|
) do |fragment|
|
88
91
|
yield fragment
|
89
92
|
end
|