nomis-api-client 0.1.2 → 0.1.3
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/auth_token.rb +4 -6
- data/lib/nomis/api/parsed_response.rb +7 -1
- 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: 8331486777f74943467a188c9edd6a6159f8b581
|
4
|
+
data.tar.gz: fabcabb0dd2386dd6068c12e4fe256dddbdd0d54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6c1cebfac9ea504914bdffcd69e23202b992c15094b60649bc2a96f76ca22105445583dfffb4758eaf87676b45888cb4a3fd2b71b275ba1f547b2be4d9cf4ff
|
7
|
+
data.tar.gz: a243ab79b348eafaf939a402e29593d97de93572cb8af935f34ca3f99c54568b82b1321be03c0dde999afd2786dd170230f778866e3175643fcffda81ce91185
|
data/lib/nomis/api/auth_token.rb
CHANGED
@@ -74,15 +74,13 @@ module NOMIS
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def default_client_key(params = {})
|
77
|
-
|
78
|
-
|
79
|
-
)
|
77
|
+
path = params[:client_key_file] || ENV['NOMIS_API_CLIENT_KEY_FILE']
|
78
|
+
path ? read_client_key_file(path) : nil
|
80
79
|
end
|
81
80
|
|
82
81
|
def default_client_token(params = {})
|
83
|
-
|
84
|
-
|
85
|
-
)
|
82
|
+
path = params[:client_token_file] || ENV['NOMIS_API_CLIENT_TOKEN_FILE']
|
83
|
+
path ? read_client_key_file(path) : nil
|
86
84
|
end
|
87
85
|
|
88
86
|
def default_iat_fudge_factor(params={})
|
@@ -9,12 +9,18 @@ module NOMIS
|
|
9
9
|
|
10
10
|
def initialize(raw_response)
|
11
11
|
self.raw_response = raw_response
|
12
|
-
self.data =
|
12
|
+
self.data = parse(raw_response)
|
13
13
|
end
|
14
14
|
|
15
15
|
def body
|
16
16
|
raw_response.body
|
17
17
|
end
|
18
|
+
|
19
|
+
def parse(response)
|
20
|
+
response.content_type == 'application/json' ? \
|
21
|
+
JSON.parse(response.body) : response.body
|
22
|
+
end
|
23
|
+
|
18
24
|
def status
|
19
25
|
raw_response.code
|
20
26
|
end
|