soaspec 0.1.10 → 0.1.11
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 +6 -1
- data/lib/soaspec/exchange_handlers/rest_accessors.rb +1 -2
- data/lib/soaspec/o_auth2.rb +11 -4
- data/lib/soaspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f8a71ef7aaaed332941f635ea0c8dae5635b2c7
|
4
|
+
data.tar.gz: ace048d3a5dbd883c0523c6f2a5f654e51b486b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13201679a589ce4856d1f9e61df09d25e8ec72242a1f4d2e8e781654e72c961c8a653555a6c3c7c9197e51b7d2643348ea0f5049115b2255b2546890db15a1b8
|
7
|
+
data.tar.gz: 52962a53cb57f808154936718de1aab8a0a30b2488e5cf2bf302e9f6c62caf8b58590c1be4832089221fcd60fd385f0bf9b490cd018a53315b9a1d2f5445d848
|
data/ChangeLog
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
+
Version 0.1.11
|
2
|
+
* Enhancements
|
3
|
+
* OAuth2 class can be initialized with strings as keys
|
4
|
+
* Global attribute, 'Soaspec::OAuth2.token_url' for setting common value
|
5
|
+
|
1
6
|
Version 0.1.10
|
2
7
|
* Enhancements
|
3
8
|
* Rename default template folder from to 'template' to 'templates'
|
4
9
|
* Use TemplateReader to simplify and add error handling to extracting templates
|
5
10
|
* Got convenience Rest Methods able to handle taking in template_name
|
6
|
-
* Started making a request method to access request of API actually sent
|
11
|
+
* Started making a 'request' method to access request of API actually sent
|
7
12
|
|
8
13
|
Version 0.1.9
|
9
14
|
* Enhancements
|
@@ -34,8 +34,7 @@ module Soaspec
|
|
34
34
|
full_path += '.yml' unless full_path.end_with?('.yml')
|
35
35
|
file_hash = YAML.load_file(full_path)
|
36
36
|
raise 'File at ' + full_path + ' is not a hash ' unless file_hash.is_a? Hash
|
37
|
-
|
38
|
-
oauth2 **oauth_hash
|
37
|
+
oauth2 file_hash
|
39
38
|
end
|
40
39
|
|
41
40
|
# @param [Hash] headers Hash of REST headers used in RestClient
|
data/lib/soaspec/o_auth2.rb
CHANGED
@@ -3,15 +3,23 @@ require 'erb'
|
|
3
3
|
module Soaspec
|
4
4
|
# Handles working with OAuth2
|
5
5
|
class OAuth2
|
6
|
+
class << self
|
7
|
+
# Default token url used across entire suite
|
8
|
+
attr_accessor :token_url
|
9
|
+
end
|
10
|
+
|
11
|
+
# [Hash] OAuth parameters
|
6
12
|
attr_accessor :params
|
7
13
|
# Count of tries to obtain access token
|
8
14
|
attr_accessor :retry_count
|
9
15
|
|
10
|
-
# @param [Hash]
|
16
|
+
# @param [Hash] params_sent Parameters to make OAuth request
|
11
17
|
# @param [String] api_username Username to use which can be set by Soaspec::ExchangeHandler
|
12
|
-
def initialize(
|
18
|
+
def initialize(params_sent, api_username = nil)
|
19
|
+
params = params_sent.transform_keys_to_symbols
|
20
|
+
params[:token_url] ||= Soaspec::OAuth2.token_url
|
13
21
|
raise 'client_id and client_secret not set' unless params[:client_id] && params[:client_secret]
|
14
|
-
raise 'token_url mandatory' unless params[:token_url]
|
22
|
+
raise ArgumentError, 'token_url mandatory' unless params[:token_url]
|
15
23
|
self.params = params
|
16
24
|
params[:username] = api_username || ERB.new(params[:username]).result(binding) if params[:username]
|
17
25
|
params[:security_token] = ERB.new(params[:security_token]).result(binding) if params[:security_token]
|
@@ -62,6 +70,5 @@ module Soaspec
|
|
62
70
|
{ grant_type: 'client_credentials' }
|
63
71
|
end)
|
64
72
|
end
|
65
|
-
|
66
73
|
end
|
67
74
|
end
|
data/lib/soaspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|