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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3182f568caa56ca4f1f2982fd34cd03add94841
4
- data.tar.gz: 0df96f12941e1b74393ebe45621d583f2e1ff956
3
+ metadata.gz: 19dafaaba6b39b922969a31020ea43fa9c93b530
4
+ data.tar.gz: 04ed01a14243a2f6763590c6bf2ef00b9f394715
5
5
  SHA512:
6
- metadata.gz: 932fe45f675620f1afa72ef36cb84fa8c54f6beebc7dd22686258fdf27c2f158a70b0a82bb7f280b111c81ae7657a01d7c5357af745247df58406efb764fd85d
7
- data.tar.gz: f0e01064bacd3a5e10f59c24b4a74fdc7c471579012a61088b60d715912113696624b1893abbbbdb0de7b63e7a70dfe46c5f450041a591cc9a4f2e9f6b8daaab
6
+ metadata.gz: e4c0e7c85069f3cb5263b41468523f07f675665f2616a1b4254dc3e588fab1f2f7e8992c6c9ba7a8ea0d774e312cb05ba2d7371de0cf8bcd1010bcabbaf81424
7
+ data.tar.gz: ad6c88d92f1563669fd2454f2eb034877040699314e8db3fe3bb65f4276a24d03baafc0ff5ba73ad5523de88940ba247374a613c0b881343a8e47f4187de8e30
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.0.50
2
+ * Enhancements
3
+ * Able to use ERB in oauth parameters and extract oauth hash with 'oauth_response' method defined by 'oauth_file'
4
+
1
5
  Version 0.0.47
2
6
  * Bug Fix
3
7
  * Using 'Strip namespace' handle both namespace or not dependent if used
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soaspec (0.0.49)
4
+ soaspec (0.0.50)
5
5
  jsonpath
6
6
  rest-client (>= 2.0)
7
7
  rspec (~> 3.0)
@@ -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('access_token') do
26
+ define_method('oauth_response') do
27
27
  response = if password && username && security_token
28
28
  RestClient.post(
29
- token_url,
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
- grant_type: 'password',
46
- client_id: client_id,
47
- client_secret: client_secret,
48
- username: username,
49
- password: password,
50
- multipart: true
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
- 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
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)['access_token']
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
 
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.49'
2
+ VERSION = '0.0.50'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.49
4
+ version: 0.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA