soaspec 0.0.62 → 0.0.63

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: dbd7cc8a04a9ee3c209638c51cce5fe42ab50f6b
4
- data.tar.gz: 66c4a49befe70c1da916637ebcf332f652b2f5ad
3
+ metadata.gz: bbd6200218cc74c240264b8f39b0061fb196d175
4
+ data.tar.gz: cbdde5a4d6771a6d91ef00101b27b92de0c35d59
5
5
  SHA512:
6
- metadata.gz: 29384e942a499abe6cb75db6cd587c77580eecdd18387eb3081190f5af548983b32c2b75f99bd425709faedfeca7fa84a93c5b4dc33e3aaf967056ba7907018b
7
- data.tar.gz: 50b486adf82d76c50d52a71468361200fc38071501395a2c29665ebf8b7bad8b870bfdb7305ca718143f23c2a98f9d6a19a93795e281afcecaa3349de4c2e7c4
6
+ metadata.gz: 37ab895847c2dd195a646aa19afbacc1135f39bcb3a6062948d7bd09a2a8368291bb0fd27decc027eabfd97653403a58a86233b68fa4990cbc7affd0de445d27
7
+ data.tar.gz: d7cb6508f82c1f4c9c0de7149df0c95c4170347fd73a634fb48d760aa39e812ba29978c2b5790b25912ac80a0c569ea0b45968d5807ae3d38a1d8df023e316bf
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.0.63
2
+ * Enhancements
3
+ * Interpret ERB for oauth credentials within oauth response. Needed for when params like 'username' can change in runtime
4
+
1
5
  Version 0.0.62
2
6
  * Enhancements
3
7
  * Use q parameter to simply to query parameters on REST requests
@@ -25,6 +25,10 @@ module Soaspec
25
25
  # Will create access_token method based on passed parameters
26
26
  def oauth2(client_id: nil, client_secret: nil, token_url: nil, username: nil, password: nil, security_token: nil)
27
27
  define_method('oauth_response') do
28
+ username = ERB.new(username).result(binding) if username
29
+ security_token = ERB.new(security_token).result(binding) if security_token
30
+ token_url = ERB.new(token_url).result(binding) if token_url
31
+ password = ERB.new(password).result(binding) if password
28
32
  payload = if password && username
29
33
  {
30
34
  grant_type: 'password',
@@ -67,7 +71,7 @@ module Soaspec
67
71
  # @param [String] path_to_filename Will have Soaspec.credentials_folder appended to it if set
68
72
  def oauth2_file(path_to_filename)
69
73
  full_path = Soaspec.credentials_folder ? File.join(Soaspec.credentials_folder, path_to_filename + '.yml') : path_to_filename + '.yml'
70
- file_hash = eval(ERB.new(YAML.load_file(full_path).to_s).result(binding))
74
+ file_hash = YAML.load_file(full_path)
71
75
  raise 'File at ' + full_path + ' is not a hash ' unless file_hash.is_a? Hash
72
76
  oauth_hash = file_hash.transform_keys_to_symbols
73
77
  oauth2 **oauth_hash
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.62'.freeze
2
+ VERSION = '0.0.63'.freeze
3
3
  end
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.0.62
4
+ version: 0.0.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2018-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler