soaspec 0.0.49 → 0.0.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/Gemfile.lock +1 -1
- data/lib/soaspec/exchange.rb +1 -1
- data/lib/soaspec/exchange_handlers/rest_handler.rb +25 -18
- data/lib/soaspec/version.rb +1 -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: 19dafaaba6b39b922969a31020ea43fa9c93b530
|
4
|
+
data.tar.gz: 04ed01a14243a2f6763590c6bf2ef00b9f394715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4c0e7c85069f3cb5263b41468523f07f675665f2616a1b4254dc3e588fab1f2f7e8992c6c9ba7a8ea0d774e312cb05ba2d7371de0cf8bcd1010bcabbaf81424
|
7
|
+
data.tar.gz: ad6c88d92f1563669fd2454f2eb034877040699314e8db3fe3bb65f4276a24d03baafc0ff5ba73ad5523de88940ba247374a613c0b881343a8e47f4187de8e30
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
data/lib/soaspec/exchange.rb
CHANGED
@@ -28,7 +28,7 @@ class Exchange
|
|
28
28
|
@override_parameters = override_parameters
|
29
29
|
@retry_for_success = false
|
30
30
|
self.retry_count = 3
|
31
|
-
puts 'ELE ' + @api_class.elements.to_s
|
31
|
+
# puts 'ELE ' + @api_class.elements.to_s
|
32
32
|
@api_class.elements.each do |element|
|
33
33
|
define_singleton_method(element) do
|
34
34
|
@api_class.__send__(element, response)
|
@@ -23,10 +23,10 @@ module Soaspec
|
|
23
23
|
|
24
24
|
# Will create access_token method based on passed parameters
|
25
25
|
def oauth2(client_id: nil, client_secret: nil, token_url: nil, username: nil, password: nil, security_token: nil)
|
26
|
-
define_method('
|
26
|
+
define_method('oauth_response') do
|
27
27
|
response = if password && username && security_token
|
28
28
|
RestClient.post(
|
29
|
-
|
29
|
+
token_url,
|
30
30
|
{
|
31
31
|
grant_type: 'password',
|
32
32
|
client_id: client_id,
|
@@ -34,7 +34,7 @@ module Soaspec
|
|
34
34
|
username: username,
|
35
35
|
password: (password + security_token),
|
36
36
|
multipart: true
|
37
|
-
|
37
|
+
},
|
38
38
|
cache_control: 'no_cache',
|
39
39
|
verify_ssl: false
|
40
40
|
)
|
@@ -42,29 +42,36 @@ module Soaspec
|
|
42
42
|
RestClient.post(
|
43
43
|
token_url,
|
44
44
|
{
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
grant_type: 'password',
|
46
|
+
client_id: client_id,
|
47
|
+
client_secret: client_secret,
|
48
|
+
username: username,
|
49
|
+
password: password,
|
50
|
+
multipart: true
|
51
51
|
},
|
52
52
|
cache_control: 'no_cache',
|
53
53
|
verify_ssl: false
|
54
54
|
)
|
55
55
|
else
|
56
56
|
RestClient.post(
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
57
|
+
token_url,
|
58
|
+
{
|
59
|
+
grant_type: 'client_credentials',
|
60
|
+
client_id: client_id,
|
61
|
+
client_secret: client_secret
|
62
|
+
},
|
63
|
+
cache_control: 'no_cache',
|
64
|
+
verify_ssl: false
|
65
65
|
)
|
66
66
|
end
|
67
|
-
JSON.parse(response)
|
67
|
+
JSON.parse(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
define_method('access_token') do
|
71
|
+
oauth_response['access_token']
|
72
|
+
end
|
73
|
+
define_method('instance_url') do
|
74
|
+
oauth_response['instance_url']
|
68
75
|
end
|
69
76
|
end
|
70
77
|
|
data/lib/soaspec/version.rb
CHANGED