soaspec 0.0.73 → 0.0.74
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/exe/soaspec-virtual-server +3 -2
- data/lib/soaspec/exchange.rb +6 -3
- data/lib/soaspec/exchange_handlers/rest_handler.rb +1 -4
- data/lib/soaspec/test_server/invoices.rb +4 -0
- 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: 43fd4464188493e9968c067148b269757e361b12
|
4
|
+
data.tar.gz: 94f6d5ea2560811e1069dcdb257f0823c777b301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32d11b91846fb9d336076babc1dec2c9a398d04b234f90fed6dfdb9cb99f80fd6ada68884a057d090cbe83be447e579eb59c7a18b8900f8dc7f435a48b29f870
|
7
|
+
data.tar.gz: 795b62a2d2eaf78cbf6d58271389bdfca3f682411669c877f3088ffa0b61b954a233986a086bbea3d7513c8c85b3f01ff9991b1a5f8882b1d5eb458e6638a9e1
|
data/ChangeLog
CHANGED
data/exe/soaspec-virtual-server
CHANGED
@@ -32,11 +32,12 @@ class SoaspecVirtualServer < Sinatra::Application
|
|
32
32
|
|
33
33
|
# Simulate retrieving an ouath token. Passed to '/invoices'
|
34
34
|
post '/as/token.oauth2' do
|
35
|
-
|
35
|
+
Soaspec::TestServer::Invoices.user_used = request.env['rack.request.form_hash']['username']
|
36
|
+
[200, Soaspec::TestServer::Invoices.oauth_headers, JSON.generate(Soaspec::TestServer::Invoices.oauth_body)]
|
36
37
|
end
|
37
38
|
|
38
39
|
get '/invoice/:id' do |id|
|
39
|
-
JSON.generate(customer_id: id, oauth: request.env['HTTP_AUTHORIZATION'])
|
40
|
+
JSON.generate(customer_id: id, oauth: request.env['HTTP_AUTHORIZATION'], user: Soaspec::TestServer::Invoices.user_used)
|
40
41
|
end
|
41
42
|
|
42
43
|
authorize do |username, password|
|
data/lib/soaspec/exchange.rb
CHANGED
@@ -5,9 +5,12 @@ module ExchangeAccessors
|
|
5
5
|
|
6
6
|
# Set default exchange handler for this exchange
|
7
7
|
# This is helpful for when you need a new exchange handler created for each exchange
|
8
|
-
def default_handler(handler_class, name = handler_class.to_s, params =
|
8
|
+
def default_handler(handler_class, name = handler_class.to_s, params = '')
|
9
9
|
define_method('default_handler_used') do
|
10
|
-
|
10
|
+
params_used = Hash[params.map do |k, param|
|
11
|
+
[k, param.is_a?(String) ? ERB.new(param).result(binding) : param]
|
12
|
+
end]
|
13
|
+
handler_class.new name, params_used
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
@@ -19,7 +22,7 @@ class Exchange
|
|
19
22
|
|
20
23
|
extend ExchangeAccessors
|
21
24
|
|
22
|
-
#
|
25
|
+
# Instance of ExchangeHandler for which this exchange is made
|
23
26
|
attr_accessor :exchange_handler
|
24
27
|
# How many times to retry for a success
|
25
28
|
attr_accessor :retry_count
|
@@ -100,10 +100,6 @@ module Soaspec
|
|
100
100
|
class RestHandler < ExchangeHandler
|
101
101
|
extend Soaspec::RestAccessors
|
102
102
|
|
103
|
-
# Savon client used to make SOAP calls
|
104
|
-
attr_accessor :client
|
105
|
-
# SOAP Operation to use by default
|
106
|
-
attr_accessor :operation
|
107
103
|
# User used in making API calls
|
108
104
|
attr_accessor :api_username
|
109
105
|
|
@@ -142,6 +138,7 @@ module Soaspec
|
|
142
138
|
name = self.class.to_s
|
143
139
|
end
|
144
140
|
super
|
141
|
+
set_remove_key(options, :api_username)
|
145
142
|
set_remove_key(options, :default_hash)
|
146
143
|
@init_options = options
|
147
144
|
end
|
data/lib/soaspec/version.rb
CHANGED