soaspec 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/lib/soaspec/exchange_handlers/rest_parameters.rb +9 -1
- data/lib/soaspec/o_auth2.rb +1 -1
- 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: 0c9254d8c1b81ec357de07757ca14a755acd0fa5
|
4
|
+
data.tar.gz: 73ae32fa4f6177094e1004709d1fe1d2250001b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdac65c8cc86cef1c33961bbc85afefecf71813756e78f395d80d5bbeb2ff7c0d1a27b42e4290ac7dce8bb67762cd542ebf5e7d5446db3b0cfda9ac7833a9ccd
|
7
|
+
data.tar.gz: 93a00b0fafc13444ad7d818da0586d450a2a4c4d173253a7f453700bb1e3ec506692a42167ec4babb843f7d3450de15e9986e782763361e7bbb89ca261414b9f
|
data/ChangeLog
CHANGED
@@ -29,7 +29,15 @@ module Soaspec
|
|
29
29
|
# Pass path to YAML file containing OAuth2 parameters
|
30
30
|
# @param [String] path_to_filename Will have Soaspec.credentials_folder appended to it if set
|
31
31
|
def oauth2_file(path_to_filename)
|
32
|
-
|
32
|
+
oauth_parameters = load_credentials_hash(path_to_filename)
|
33
|
+
@client_id = oauth_parameters[:client_id] if oauth_parameters[:client_id]
|
34
|
+
oauth2 oauth_parameters
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [String] Client id obtained from credentials file
|
38
|
+
def client_id
|
39
|
+
raise '@client_id is not set. Set by specifying credentials file with "oauth2_file FILENAME" before this is called' unless @client_id
|
40
|
+
@client_id
|
33
41
|
end
|
34
42
|
|
35
43
|
# Define basic authentication
|
data/lib/soaspec/o_auth2.rb
CHANGED
@@ -36,7 +36,7 @@ module Soaspec
|
|
36
36
|
self.retry_count = 0 # No initial tries at getting access token
|
37
37
|
params = params_sent.transform_keys_to_symbols
|
38
38
|
params[:token_url] ||= Soaspec::OAuth2.token_url
|
39
|
-
raise 'client_id and client_secret not set' unless params[:client_id] && params[:client_secret]
|
39
|
+
raise ArgumentError, 'client_id and client_secret not set' unless params[:client_id] && params[:client_secret]
|
40
40
|
raise ArgumentError, 'token_url mandatory' unless params[:token_url]
|
41
41
|
self.params = params
|
42
42
|
params[:username] = api_username || ERB.new(params[:username]).result(binding) if params[:username]
|
data/lib/soaspec/version.rb
CHANGED