nomis-api-client 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nomis/api/get.rb +3 -1
- data/lib/nomis/api/post.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c74e913c003850a8e513dc4c0eb3e239a22ec10
|
4
|
+
data.tar.gz: b2a177bc685633f7d01bea8d32021190cab6bb95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eac8f364a42a57b8cda71cec90d5c91db264e481debdcb665cc62c4593d877a88fe6fe58c79bd81f4db8423774915ea3469b30609d9371187292c81efe9522d
|
7
|
+
data.tar.gz: 5150a2d892d242f27dd31536e2b0f2bdf57705d67f4c01eb0275de400fa2dd7fdc0b92075064d1e7d1a2115f94397aa1dc8fa6390d02463dd8fda4d10b748525
|
data/lib/nomis/api/get.rb
CHANGED
@@ -11,13 +11,14 @@ module NOMIS
|
|
11
11
|
# Manages defaulting of params from env vars,
|
12
12
|
# and parsing the returned JSON
|
13
13
|
class Get
|
14
|
-
attr_accessor :params, :auth_token, :base_url, :path
|
14
|
+
attr_accessor :params, :auth_token, :base_url, :path, :disable_ssl_verify
|
15
15
|
|
16
16
|
def initialize(opts={})
|
17
17
|
self.auth_token = opts[:auth_token] || default_auth_token(opts)
|
18
18
|
self.base_url = opts[:base_url] || ENV['NOMIS_API_BASE_URL']
|
19
19
|
self.params = opts[:params] || {}
|
20
20
|
self.path = opts[:path]
|
21
|
+
self.disable_ssl_verify = opts[:disable_ssl_verify]
|
21
22
|
end
|
22
23
|
|
23
24
|
def execute
|
@@ -39,6 +40,7 @@ module NOMIS
|
|
39
40
|
def get_response(req)
|
40
41
|
http = Net::HTTP.new(req.uri.hostname, req.uri.port)
|
41
42
|
http.use_ssl = (req.uri.scheme == "https")
|
43
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if disable_ssl_verify
|
42
44
|
http.request(req)
|
43
45
|
end
|
44
46
|
end
|
data/lib/nomis/api/post.rb
CHANGED
@@ -11,13 +11,14 @@ module NOMIS
|
|
11
11
|
# Manages defaulting of params from env vars,
|
12
12
|
# and parsing the returned JSON
|
13
13
|
class Post
|
14
|
-
attr_accessor :params, :auth_token, :base_url, :path
|
14
|
+
attr_accessor :params, :auth_token, :base_url, :path, :disable_ssl_verify
|
15
15
|
|
16
16
|
def initialize(opts={})
|
17
17
|
self.auth_token = opts[:auth_token] || default_auth_token(opts)
|
18
18
|
self.base_url = opts[:base_url] || ENV['NOMIS_API_BASE_URL']
|
19
19
|
self.params = opts[:params]
|
20
20
|
self.path = opts[:path]
|
21
|
+
self.disable_ssl_verify = opts[:disable_ssl_verify]
|
21
22
|
end
|
22
23
|
|
23
24
|
def execute
|
@@ -41,6 +42,7 @@ module NOMIS
|
|
41
42
|
def post_response(req)
|
42
43
|
http = Net::HTTP.new(req.uri.hostname, req.uri.port)
|
43
44
|
http.use_ssl = (req.uri.scheme == 'https')
|
45
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if disable_ssl_verify
|
44
46
|
req.body = params.to_json
|
45
47
|
http.request(req)
|
46
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nomis-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Al Davidson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|