allscripts_unity_client 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/allscripts_unity_client/client_driver.rb +2 -0
- data/lib/allscripts_unity_client/json_client_driver.rb +21 -15
- data/lib/allscripts_unity_client/soap_client_driver.rb +9 -4
- data/lib/allscripts_unity_client/version.rb +1 -1
- data/spec/support/shared_examples_for_client_driver.rb +2 -0
- 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: 4c922415ede669a67b8aaeca965cc57255876148
|
4
|
+
data.tar.gz: 1fd6a6104626ae99644f1f401fad660abf6203a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f47a0208fee44b5004174d1ee0a10e0fb6bebc3929bc508586b3b82ed0041f1ee8e1ec59fea27f2a622ad9335c71c70150cd4d96253de6e0352bf8f4569c947a
|
7
|
+
data.tar.gz: 4357b82d41a3bdc9fbead4803379408ab988285773e6178a1b66684c56f24b372e5fa5ac4430bfed4dc1842686b28172578abd07efef493cc84628eedd359e3d
|
@@ -32,8 +32,8 @@ module AllscriptsUnityClient
|
|
32
32
|
|
33
33
|
start_timer
|
34
34
|
end
|
35
|
+
end_timer
|
35
36
|
end
|
36
|
-
end_timer
|
37
37
|
|
38
38
|
response = Oj.load(response.body, mode: :strict)
|
39
39
|
|
@@ -55,15 +55,18 @@ module AllscriptsUnityClient
|
|
55
55
|
'Appname' => appname
|
56
56
|
}
|
57
57
|
|
58
|
-
response =
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
response = nil
|
59
|
+
NewRelicSupport.trace_execution_scoped_if_available(JSONClientDriver, ["Custom/UnityJSON/GetToken"]) do
|
60
|
+
response = @connection.post do |request|
|
61
|
+
request.url "#{UNITY_JSON_ENDPOINT}/GetToken"
|
62
|
+
request.headers['Content-Type'] = 'application/json'
|
63
|
+
request.body = Oj.dump(request_data, mode: :compat)
|
64
|
+
set_request_timeout(request)
|
63
65
|
|
64
|
-
|
66
|
+
start_timer
|
67
|
+
end
|
68
|
+
end_timer
|
65
69
|
end
|
66
|
-
end_timer
|
67
70
|
|
68
71
|
raise_if_response_error(response.body)
|
69
72
|
log_get_security_token
|
@@ -80,15 +83,18 @@ module AllscriptsUnityClient
|
|
80
83
|
'Appname' => appname
|
81
84
|
}
|
82
85
|
|
83
|
-
response =
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
86
|
+
response = nil
|
87
|
+
NewRelicSupport.trace_execution_scoped_if_available(JSONClientDriver, ["Custom/UnityJSON/RetireSecurityToken"]) do
|
88
|
+
response = @connection.post do |request|
|
89
|
+
request.url "#{UNITY_JSON_ENDPOINT}/RetireSecurityToken"
|
90
|
+
request.headers['Content-Type'] = 'application/json'
|
91
|
+
request.body = Oj.dump(request_data, mode: :compat)
|
92
|
+
set_request_timeout(request)
|
88
93
|
|
89
|
-
|
94
|
+
start_timer
|
95
|
+
end
|
96
|
+
end_timer
|
90
97
|
end
|
91
|
-
end_timer
|
92
98
|
|
93
99
|
raise_if_response_error(response.body)
|
94
100
|
log_retire_security_token
|
@@ -92,8 +92,11 @@ module AllscriptsUnityClient
|
|
92
92
|
|
93
93
|
begin
|
94
94
|
start_timer
|
95
|
-
response =
|
96
|
-
|
95
|
+
response = nil
|
96
|
+
NewRelicSupport.trace_execution_scoped_if_available(JSONClientDriver, ["Custom/UnitySOAP/GetToken"]) do
|
97
|
+
response = @savon_client.call('GetSecurityToken', call_data)
|
98
|
+
end_timer
|
99
|
+
end
|
97
100
|
rescue Savon::SOAPFault => e
|
98
101
|
raise APIError, e.message
|
99
102
|
end
|
@@ -117,8 +120,10 @@ module AllscriptsUnityClient
|
|
117
120
|
|
118
121
|
begin
|
119
122
|
start_timer
|
120
|
-
|
121
|
-
|
123
|
+
NewRelicSupport.trace_execution_scoped_if_available(JSONClientDriver, ["Custom/UnitySOAP/RetireSecurityToken"]) do
|
124
|
+
@savon_client.call('RetireSecurityToken', call_data)
|
125
|
+
end_timer
|
126
|
+
end
|
122
127
|
rescue Savon::SOAPFault => e
|
123
128
|
raise APIError, e.message
|
124
129
|
end
|
@@ -7,6 +7,8 @@ shared_examples 'a client driver' do
|
|
7
7
|
new_relic_client_driver
|
8
8
|
expect(AllscriptsUnityClient::NewRelicSupport).to have_received(:enable_method_tracer).with(new_relic_client_driver)
|
9
9
|
expect(described_class).to have_received(:add_method_tracer).with(:magic)
|
10
|
+
expect(described_class).to have_received(:add_method_tracer).with(:get_security_token!)
|
11
|
+
expect(described_class).to have_received(:add_method_tracer).with(:retire_security_token!)
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|