krakend-openapi-importer 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: eccd5c3cd0254e656a85647f09b55dc6ab23a2cbe12df54f300e9f55b6232680
4
- data.tar.gz: 1c00cf1e660f5f2d0c56eb82eea50300448b433f6396476ec2c5d0b212720703
3
+ metadata.gz: d3a9eaa2da627c77ada30ddbb82c624063130d80c59087f3a57b9a8eb366afb8
4
+ data.tar.gz: a6e0280bee0c8a7a14cf669ac29bd341b29125e34fda209170c9eb8497556110
5
5
  SHA512:
6
- metadata.gz: 9fd2c84e3b98e8953a26b730804179c3b567ec0e3b70e242e53ab4d8d9fc52123894c174a82c382e405fbd09368c460b989c68bd27c107b2d2fd432dacafd466
7
- data.tar.gz: b10e0267cd7a62694bfe94ce853fc5f648d3a88adacc667855d6fafb012084e7ece04a399960d0cdf8e531bfd27317fbebc4c16e9ff67ada60f0f74f7433f025
6
+ metadata.gz: 2d41c42b8df2419cf1c50dc3688d1461abceedb1fc25506a5c13ab32751a9323eff94d8b62fd15c4a8782903d3e299c3ec180976f3fbe2035df95f1b8589325d
7
+ data.tar.gz: cd0bcff75ae8effeca81e6fadb7afea44de51c2460a9c09e8c581370f67a5b05f5b216b5ae4f999571c9d001eb3869a749dabb7879d828b14f9a23c7ac937508
data/Gemfile CHANGED
@@ -6,5 +6,12 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  gem 'rake', '~> 13.0'
9
- gem 'rspec', '~> 3.0'
10
- gem 'rubocop', require: false
9
+
10
+ group :test do
11
+ gem 'fakefs', '~> 2.0'
12
+ gem 'minitest', '~> 5.13'
13
+ end
14
+
15
+ group :development do
16
+ gem 'rubocop', require: false
17
+ end
data/Gemfile.lock CHANGED
@@ -1,15 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- krakend-openapi-importer (0.3.0)
4
+ krakend-openapi-importer (0.3.1)
5
5
  thor (~> 1.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
- diff-lcs (1.4.4)
11
+ fakefs (2.0.0)
12
12
  json (2.6.2)
13
+ minitest (5.13.0)
13
14
  parallel (1.22.1)
14
15
  parser (3.1.2.1)
15
16
  ast (~> 2.4.1)
@@ -17,19 +18,6 @@ GEM
17
18
  rake (13.0.6)
18
19
  regexp_parser (2.6.1)
19
20
  rexml (3.2.5)
20
- rspec (3.10.0)
21
- rspec-core (~> 3.10.0)
22
- rspec-expectations (~> 3.10.0)
23
- rspec-mocks (~> 3.10.0)
24
- rspec-core (3.10.1)
25
- rspec-support (~> 3.10.0)
26
- rspec-expectations (3.10.1)
27
- diff-lcs (>= 1.2.0, < 2.0)
28
- rspec-support (~> 3.10.0)
29
- rspec-mocks (3.10.2)
30
- diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.10.0)
32
- rspec-support (3.10.2)
33
21
  rubocop (1.39.0)
34
22
  json (~> 2.3)
35
23
  parallel (~> 1.10)
@@ -52,9 +40,10 @@ PLATFORMS
52
40
  x86_64-darwin-21
53
41
 
54
42
  DEPENDENCIES
43
+ fakefs (~> 2.0)
55
44
  krakend-openapi-importer!
45
+ minitest (~> 5.13)
56
46
  rake (~> 13.0)
57
- rspec (~> 3.0)
58
47
  rubocop
59
48
 
60
49
  BUNDLED WITH
data/Rakefile CHANGED
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
4
+ require 'rake/testtask'
5
5
 
6
- RSpec::Core::RakeTask.new(:spec)
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << 'test'
8
+ t.libs << 'lib'
9
+ t.test_files = FileList['test/**/*_test.rb']
10
+ end
7
11
 
8
- task default: :spec
12
+ task default: :test
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KrakendOpenAPI
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
4
+
3
5
  module KrakendOpenAPI
4
6
  # Reads JSON files
5
7
  class JsonReader
@@ -24,10 +24,12 @@ module KrakendOpenAPI
24
24
  roles = operation['x-jwt-roles']&.length ? operation['x-jwt-roles'] : @importer_config['all_roles']
25
25
 
26
26
  plugins = []
27
- plugins << JwtValidatorTransformer
28
- .new
29
- .transform_to_hash(roles: roles,
30
- config: @importer_config['defaults']['plugins']['auth_validator'])
27
+ if @importer_config['defaults']&.dig('plugins', 'auth_validator')
28
+ plugins << JwtValidatorTransformer
29
+ .new
30
+ .transform_to_hash(roles: roles,
31
+ config: @importer_config['defaults']['plugins']['auth_validator'])
32
+ end
31
33
 
32
34
  endpoint = {
33
35
  endpoint: path,
@@ -38,11 +40,14 @@ module KrakendOpenAPI
38
40
  backend: [{ url_pattern: path, encoding: @importer_config['defaults']['backend'][0]['encoding'] }]
39
41
  }
40
42
 
41
- extra_config = plugins.each_with_object({}) do |plugin, memo|
42
- memo[plugin[:name].to_sym] = plugin[:value]
43
+ if plugins&.length > 0
44
+ extra_config = plugins.each_with_object({}) do |plugin, memo|
45
+ memo[plugin[:name].to_sym] = plugin[:value]
46
+ end
47
+
48
+ endpoint[:extra_config] = extra_config
43
49
  end
44
50
 
45
- endpoint[:extra_config] = extra_config
46
51
  endpoint
47
52
  end
48
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: krakend-openapi-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Semenenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-27 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -35,7 +35,6 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - ".github/workflows/main.yml"
37
37
  - ".gitignore"
38
- - ".rspec"
39
38
  - ".ruby-version"
40
39
  - Gemfile
41
40
  - Gemfile.lock
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper