soaspec 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +18 -15
- data/.rubocop.yml +11 -1
- data/ChangeLog +4 -0
- data/lib/soaspec/exchange_handlers/request/rest_request.rb +1 -1
- data/lib/soaspec/exchange_handlers/rest_handler.rb +1 -1
- data/lib/soaspec/exchange_handlers/soap_defaults.rb +2 -1
- data/lib/soaspec/exchange_handlers/soap_globals.rb +2 -0
- data/lib/soaspec/o_auth2.rb +15 -8
- data/lib/soaspec/version.rb +1 -1
- data/soaspec.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff535556597fbdc9006d5e9482e5fd835edfb39c76a9607cb7d5c05fae6291ca
|
4
|
+
data.tar.gz: af6b528b564ec301a9cb80ede31bc8edaaeabccb594cb7cb85949c0057e29b7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c53fdf6578f58b9625a46cb85928e13ee566f9bffc1778f0edf5365d50196c239adf847df72a9e38a0fa1f6d5e775b3706e21d042be21504049015586aa0ce9
|
7
|
+
data.tar.gz: 27e48e5546ec9ccdcbc72fd958a8c4255c87f2ce71a288aa01a5b7299315ea6cde4e19bcba6fa2183872d78e7a5f23bc4ca15be4d62a1b4d2656a16bb7b46cfe
|
data/.gitlab-ci.yml
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
image: ruby:2.
|
1
|
+
image: ruby:2.6
|
2
2
|
|
3
|
-
|
4
|
-
-
|
5
|
-
- which ruby
|
6
|
-
- gem install bundler rake
|
7
|
-
- bundle install --jobs $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
3
|
+
include:
|
4
|
+
- template: Code-Quality.gitlab-ci.yml
|
8
5
|
|
9
6
|
cache:
|
10
7
|
key: ${CI_COMMIT_REF_SLUG}
|
11
8
|
paths:
|
12
9
|
- vendor/ruby
|
13
10
|
|
11
|
+
.ruby_test: &ruby_test
|
12
|
+
script:
|
13
|
+
- gem install bundler rake
|
14
|
+
- bundle install --jobs $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
15
|
+
- bundle exec rake
|
16
|
+
|
14
17
|
ruby_2.3:
|
15
18
|
stage: test
|
16
19
|
image: ruby:2.3
|
17
|
-
|
18
|
-
- bundle exec rake
|
20
|
+
<<: *ruby_test
|
19
21
|
|
20
22
|
ruby_2.4:
|
21
23
|
stage: test
|
22
24
|
image: ruby:2.4
|
23
|
-
|
24
|
-
- bundle exec rake
|
25
|
+
<<: *ruby_test
|
25
26
|
|
26
27
|
ruby_2.5:
|
27
28
|
stage: test
|
28
29
|
image: ruby:2.5
|
29
|
-
|
30
|
-
- bundle exec rake
|
30
|
+
<<: *ruby_test
|
31
31
|
artifacts:
|
32
32
|
paths:
|
33
33
|
- coverage/
|
@@ -35,25 +35,28 @@ ruby_2.5:
|
|
35
35
|
ruby_2.6:
|
36
36
|
stage: test
|
37
37
|
image: ruby:2.6
|
38
|
-
|
39
|
-
- bundle exec rake
|
38
|
+
<<: *ruby_test
|
40
39
|
|
41
40
|
cucumber:
|
42
41
|
image: samuelgarratt/soaspec
|
43
42
|
stage: test
|
44
43
|
script:
|
44
|
+
- gem install bundler
|
45
|
+
- bundle install
|
45
46
|
- bundle exec cucumber
|
46
47
|
|
47
48
|
doctest:
|
48
49
|
image: samuelgarratt/soaspec
|
49
50
|
stage: test
|
50
51
|
script:
|
52
|
+
- gem install bundler
|
53
|
+
- bundle install
|
51
54
|
- bundle exec rake yard:doctest
|
52
55
|
|
53
56
|
pages:
|
54
57
|
stage: deploy
|
55
58
|
dependencies:
|
56
|
-
- ruby_2.
|
59
|
+
- ruby_2.6
|
57
60
|
script:
|
58
61
|
- mv demo/ public/
|
59
62
|
- mv coverage/ public/coverage
|
data/.rubocop.yml
CHANGED
@@ -1,2 +1,12 @@
|
|
1
|
-
|
1
|
+
Layout/LineLength:
|
2
2
|
Max: 154
|
3
|
+
Lint/RaiseException:
|
4
|
+
Enabled: true
|
5
|
+
Lint/StructNewOverride:
|
6
|
+
Enabled: true
|
7
|
+
Style/HashEachMethods:
|
8
|
+
Enabled: true
|
9
|
+
Style/HashTransformKeys:
|
10
|
+
Enabled: true
|
11
|
+
Style/HashTransformValues:
|
12
|
+
Enabled: true
|
data/ChangeLog
CHANGED
@@ -164,7 +164,7 @@ module Soaspec
|
|
164
164
|
def concat_urls(url, suburl)
|
165
165
|
url = url.to_s
|
166
166
|
suburl = suburl.to_s
|
167
|
-
if url.slice(-1, 1) == '/'
|
167
|
+
if (url.slice(-1, 1) == '/') || (suburl.slice(0, 1) == '/')
|
168
168
|
url + suburl
|
169
169
|
else
|
170
170
|
"#{url}/#{suburl}"
|
@@ -203,7 +203,7 @@ module Soaspec
|
|
203
203
|
raise NoElementAtPath, "No value at Xpath '#{prefix_xpath(path, attribute)}' in '#{response.body}'" unless result
|
204
204
|
return result.inner_text if attribute.nil?
|
205
205
|
|
206
|
-
|
206
|
+
result.attributes[attribute].inner_text
|
207
207
|
when :json
|
208
208
|
matching_values = calculated_json_path_matches(path, response, attribute, not_empty: true)
|
209
209
|
matching_values.first
|
data/lib/soaspec/o_auth2.rb
CHANGED
@@ -55,6 +55,7 @@ module Soaspec
|
|
55
55
|
# @option params_sent [client_secret] Client Secret
|
56
56
|
# @option params_sent [username] Username used in password grant
|
57
57
|
# @option params_sent [password] Password used in password grant
|
58
|
+
# @option params_sent [resource] Api server that handles authenticated requests
|
58
59
|
# @option params_sent [security_token] Security Token used in password grant
|
59
60
|
# @param [String] api_username Username to use which can be set by Soaspec::ExchangeHandler
|
60
61
|
def initialize(params_sent, api_username = nil)
|
@@ -129,18 +130,24 @@ module Soaspec
|
|
129
130
|
# @return [Hash] Payload for retrieving OAuth access token
|
130
131
|
def payload
|
131
132
|
payload = { client_id: params[:client_id], client_secret: params[:client_secret] }
|
132
|
-
payload.merge(if params[:password] && params[:username]
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
end)
|
133
|
+
payload.merge!(if params[:password] && params[:username]
|
134
|
+
password_grant_type_params
|
135
|
+
else
|
136
|
+
{ grant_type: 'client_credentials' }.merge multipart false
|
137
|
+
end)
|
138
|
+
payload[:resource] = params[:resource] if params[:resource]
|
139
|
+
payload
|
140
140
|
end
|
141
141
|
|
142
142
|
private
|
143
143
|
|
144
|
+
def password_grant_type_params
|
145
|
+
{
|
146
|
+
grant_type: 'password', username: params[:username],
|
147
|
+
password: password
|
148
|
+
}.merge multipart true
|
149
|
+
end
|
150
|
+
|
144
151
|
# @param [Boolean] default Default value for multipart
|
145
152
|
# @return [Hash] Multipart set to true if not set and is grant_type password
|
146
153
|
def multipart(default)
|
data/lib/soaspec/version.rb
CHANGED
data/soaspec.gemspec
CHANGED
@@ -14,6 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.description = "Helps to create tests for 'SOAP' or 'REST' apis. Easily represent multiple requests with
|
15
15
|
the same configuration. Examples designed for RSpec and Cucumber."
|
16
16
|
spec.homepage = 'https://gitlab.com/samuel-garratt/soaspec'
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
17
18
|
spec.license = 'MIT'
|
18
19
|
|
19
20
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -22,7 +23,6 @@ the same configuration. Examples designed for RSpec and Cucumber."
|
|
22
23
|
spec.bindir = 'exe'
|
23
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
25
|
spec.require_paths = ['lib']
|
25
|
-
spec.required_ruby_version = '>= 2.3.0'
|
26
26
|
|
27
27
|
spec.add_development_dependency 'bundler'
|
28
28
|
spec.add_development_dependency 'cucumber'
|
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.3.
|
4
|
+
version: 0.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|