krakend-openapi-importer 0.4.0 → 1.0.0
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/.github/workflows/main.yml +21 -6
- data/.rubocop.yml +23 -0
- data/.ruby-version +0 -1
- data/Gemfile +5 -4
- data/Gemfile.lock +33 -25
- data/README.md +14 -10
- data/Rakefile +5 -0
- data/krakend-openapi-importer.gemspec +4 -3
- data/lib/commands/import.rb +2 -2
- data/lib/importer/version.rb +1 -1
- data/lib/readers/json_reader.rb +1 -1
- data/lib/readers/oa3_reader.rb +17 -12
- data/lib/readers/yaml_reader.rb +1 -1
- data/lib/transformers/oa3_transformer.rb +53 -19
- data/lib/transformers/plugins/auth_validator_transformer.rb +6 -11
- data/lib/writers/krakend_writer.rb +36 -7
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fa4ce1569286791f7a82d516f39378a66443d7e62edb4fcb58f91e44a34e71c
|
4
|
+
data.tar.gz: 2481a698b885aa0f7e958e86abaa608b433b25b9ad927c5e02aaeaa4daaebdda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c1c325b4bc2a16302fb75df279fd8cb62f305d3379c27e1d91f52fdbf109a8604b20343640a9fcaf1412585e1065c82433112d7e746b74e9672d23e6262416
|
7
|
+
data.tar.gz: a3a73662c1d3e274e82d29a357e82004fe5ed6408afd51feac8795efac9ba7929b265e5fa4c9c45741818407d63e7d44cb37f7ba97c680ab0623ee3df68a2037
|
data/.github/workflows/main.yml
CHANGED
@@ -1,16 +1,31 @@
|
|
1
|
-
name:
|
1
|
+
name: testing
|
2
2
|
|
3
3
|
on: [push,pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
|
-
|
6
|
+
test:
|
7
7
|
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby-version: [ '2.7', '3.0', '3.1', '3.2', '3.3', '3.4' ]
|
8
12
|
steps:
|
9
|
-
- uses: actions/checkout@
|
13
|
+
- uses: actions/checkout@v4
|
10
14
|
- name: Set up Ruby
|
11
|
-
uses: ruby/setup-ruby@v1
|
15
|
+
uses: ruby/setup-ruby@v1.216.0
|
12
16
|
with:
|
13
|
-
ruby-version:
|
17
|
+
ruby-version: ${{ matrix.ruby-version }}
|
14
18
|
bundler-cache: true
|
15
|
-
- name: Run
|
19
|
+
- name: Run tests
|
16
20
|
run: bundle exec rake
|
21
|
+
lint:
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v4
|
25
|
+
- name: Set up Ruby
|
26
|
+
uses: ruby/setup-ruby@v1.216.0
|
27
|
+
with:
|
28
|
+
ruby-version: '3.0'
|
29
|
+
bundler-cache: true
|
30
|
+
- name: Run linter
|
31
|
+
run: bundle exec rubocop
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
NewCops: enable
|
6
|
+
|
7
|
+
Layout/LineLength:
|
8
|
+
Max: 120
|
9
|
+
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 34
|
12
|
+
|
13
|
+
Metrics/CyclomaticComplexity:
|
14
|
+
Max: 14
|
15
|
+
|
16
|
+
Metrics/PerceivedComplexity:
|
17
|
+
Max: 16
|
18
|
+
|
19
|
+
Metrics/MethodLength:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Metrics/BlockLength:
|
23
|
+
Enabled: false
|
data/.ruby-version
CHANGED
data/Gemfile
CHANGED
@@ -5,16 +5,17 @@ source 'https://rubygems.org'
|
|
5
5
|
# Specify your gem's dependencies in krakend-openapi-importer.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem 'rake', '~> 13.0'
|
8
|
+
gem 'rake', '~> 13.0', '>= 13.2.1'
|
9
9
|
|
10
10
|
group :test do
|
11
|
-
gem 'fakefs', '~> 2.0'
|
12
|
-
gem 'minitest', '~> 5.
|
11
|
+
gem 'fakefs', '~> 2.8', '>= 2.8.0'
|
12
|
+
gem 'minitest', '~> 5.25', '>= 5.25.4'
|
13
13
|
end
|
14
14
|
|
15
15
|
group :development do
|
16
16
|
gem 'bump', '~> 0.10.0'
|
17
|
-
gem 'rubocop', require: false
|
17
|
+
gem 'rubocop', '~> 1.71', require: false
|
18
|
+
gem 'rubocop-performance', require: false
|
18
19
|
end
|
19
20
|
|
20
21
|
group :test, :development do
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
krakend-openapi-importer (0.
|
4
|
+
krakend-openapi-importer (1.0.0)
|
5
5
|
thor (~> 1.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -10,31 +10,38 @@ GEM
|
|
10
10
|
ast (2.4.2)
|
11
11
|
awesome_print (1.9.2)
|
12
12
|
bump (0.10.0)
|
13
|
-
fakefs (2.
|
14
|
-
json (2.
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
fakefs (2.8.0)
|
14
|
+
json (2.9.1)
|
15
|
+
language_server-protocol (3.17.0.4)
|
16
|
+
minitest (5.25.4)
|
17
|
+
parallel (1.26.3)
|
18
|
+
parser (3.3.7.1)
|
18
19
|
ast (~> 2.4.1)
|
20
|
+
racc
|
21
|
+
racc (1.8.1)
|
19
22
|
rainbow (3.1.1)
|
20
|
-
rake (13.
|
21
|
-
regexp_parser (2.
|
22
|
-
|
23
|
-
rubocop (1.39.0)
|
23
|
+
rake (13.2.1)
|
24
|
+
regexp_parser (2.10.0)
|
25
|
+
rubocop (1.71.2)
|
24
26
|
json (~> 2.3)
|
27
|
+
language_server-protocol (>= 3.17.0)
|
25
28
|
parallel (~> 1.10)
|
26
|
-
parser (>= 3.
|
29
|
+
parser (>= 3.3.0.2)
|
27
30
|
rainbow (>= 2.2.2, < 4.0)
|
28
|
-
regexp_parser (>=
|
29
|
-
|
30
|
-
rubocop-ast (>= 1.23.0, < 2.0)
|
31
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
32
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
31
33
|
ruby-progressbar (~> 1.7)
|
32
|
-
unicode-display_width (>=
|
33
|
-
rubocop-ast (1.
|
34
|
-
parser (>= 3.
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
35
|
+
rubocop-ast (1.38.0)
|
36
|
+
parser (>= 3.3.1.0)
|
37
|
+
rubocop-performance (1.23.1)
|
38
|
+
rubocop (>= 1.48.1, < 2.0)
|
39
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
40
|
+
ruby-progressbar (1.13.0)
|
41
|
+
thor (1.3.2)
|
42
|
+
unicode-display_width (3.1.4)
|
43
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
44
|
+
unicode-emoji (4.0.4)
|
38
45
|
|
39
46
|
PLATFORMS
|
40
47
|
ruby
|
@@ -44,11 +51,12 @@ PLATFORMS
|
|
44
51
|
DEPENDENCIES
|
45
52
|
awesome_print
|
46
53
|
bump (~> 0.10.0)
|
47
|
-
fakefs (~> 2.0)
|
54
|
+
fakefs (~> 2.8, >= 2.8.0)
|
48
55
|
krakend-openapi-importer!
|
49
|
-
minitest (~> 5.
|
50
|
-
rake (~> 13.0)
|
51
|
-
rubocop
|
56
|
+
minitest (~> 5.25, >= 5.25.4)
|
57
|
+
rake (~> 13.0, >= 13.2.1)
|
58
|
+
rubocop (~> 1.71)
|
59
|
+
rubocop-performance
|
52
60
|
|
53
61
|
BUNDLED WITH
|
54
|
-
2.
|
62
|
+
2.4.22
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Import endpoints from OpenAPI spec to KrakenD endpoint configuration. Supports O
|
|
4
4
|
|
5
5
|
[](https://github.com/denblackstache/krakend-openapi-importer/actions/workflows/main.yml) [](https://badge.fury.io/rb/krakend-openapi-importer)
|
6
6
|
|
7
|
-
In case you have a different version of OpenAPI you can use https://github.com/LucyBot-Inc/api-spec-converter to convert to the v3.0.
|
7
|
+
In case you have a different version of OpenAPI you can use <https://github.com/LucyBot-Inc/api-spec-converter> to convert to the v3.0.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -17,7 +17,7 @@ Execute
|
|
17
17
|
Import OpenAPI spec from SPEC file. Writes KrakenD config to output.json
|
18
18
|
|
19
19
|
```bash
|
20
|
-
krakend-openapi-importer import SPEC -c CONFIG
|
20
|
+
krakend-openapi-importer import SPEC -c CONFIG
|
21
21
|
```
|
22
22
|
|
23
23
|
```bash
|
@@ -31,24 +31,28 @@ Example config
|
|
31
31
|
|
32
32
|
```yaml
|
33
33
|
---
|
34
|
-
all_roles: [
|
34
|
+
all_roles: ["admin", "guest"] # all available roles for JWT validator
|
35
35
|
pretty: true
|
36
|
-
|
36
|
+
format: "json" # can be 'json' or 'yaml', defaults to `json`
|
37
|
+
output: "output.json"
|
37
38
|
defaults:
|
39
|
+
base:
|
40
|
+
name: Example application
|
38
41
|
endpoint:
|
39
42
|
output_encoding: "no-op" # act like a no-op proxy
|
40
|
-
input_headers: [
|
41
|
-
input_query_strings: [
|
43
|
+
input_headers: ["*"]
|
44
|
+
input_query_strings: ["*"]
|
42
45
|
backend:
|
43
46
|
- encoding: "no-op"
|
44
47
|
plugins:
|
45
48
|
auth_validator:
|
46
|
-
alg:
|
47
|
-
jwk_url:
|
49
|
+
alg: "RS256"
|
50
|
+
jwk_url: "https://KEYCLOAK_URL/auth/realms/master/protocol/openid-connect/certs"
|
48
51
|
cache: false
|
49
52
|
operation_debug: true
|
50
|
-
roles_key:
|
53
|
+
roles_key: "realm_access.roles"
|
51
54
|
roles_key_is_nested: true
|
55
|
+
scopes_key: scopes # only needed when defining scopes in openapi spec
|
52
56
|
```
|
53
57
|
|
54
58
|
## Development
|
@@ -59,7 +63,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
59
63
|
|
60
64
|
## Contributing
|
61
65
|
|
62
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/denblackstache/krakend-openapi-importer
|
66
|
+
Bug reports and pull requests are welcome on GitHub at <https://github.com/denblackstache/krakend-openapi-importer>.
|
63
67
|
|
64
68
|
## License
|
65
69
|
|
data/Rakefile
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '
|
3
|
+
require_relative 'lib/importer/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'krakend-openapi-importer'
|
7
7
|
spec.version = KrakendOpenAPI::VERSION
|
8
8
|
spec.authors = ['Denis Semenenko']
|
9
|
-
spec.email = ['
|
9
|
+
spec.email = ['den@densemenenko.com']
|
10
10
|
|
11
11
|
spec.summary = 'Import OpenAPI spec to KrakenD configuration'
|
12
12
|
spec.description = 'Import endpoints from OpenAPI spec to KrakenD endpoint configuration. Supports OpenAPI v3.0'
|
13
|
-
spec.homepage = 'https://
|
13
|
+
spec.homepage = 'https://github.com/denblackstache/krakend-openapi-importer'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
spec.required_ruby_version = '>= 2.7'
|
16
16
|
|
17
17
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
18
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
18
19
|
|
19
20
|
spec.metadata['homepage_uri'] = spec.homepage
|
20
21
|
spec.metadata['source_code_uri'] = 'https://github.com/denblackstache/krakend-openapi-importer'
|
data/lib/commands/import.rb
CHANGED
@@ -16,8 +16,8 @@ module KrakendOpenAPI
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def execute
|
19
|
-
|
20
|
-
endpoints = OA3ToKrakendTransformer.new(
|
19
|
+
oa3_doc = OA3Reader.new(@spec)
|
20
|
+
endpoints = OA3ToKrakendTransformer.new(oa3_doc, @importer_config).transform_paths
|
21
21
|
KrakendWriter.new(endpoints, @importer_config).write
|
22
22
|
end
|
23
23
|
end
|
data/lib/importer/version.rb
CHANGED
data/lib/readers/json_reader.rb
CHANGED
data/lib/readers/oa3_reader.rb
CHANGED
@@ -11,22 +11,27 @@ module KrakendOpenAPI
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def paths
|
14
|
-
|
15
|
-
@data['paths']
|
14
|
+
data['paths']
|
16
15
|
end
|
17
16
|
|
18
|
-
|
17
|
+
def security
|
18
|
+
data['security']
|
19
|
+
end
|
19
20
|
|
20
|
-
def
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
else
|
26
|
-
raise StandardError, 'OA3Reader does not support this format'
|
27
|
-
end
|
21
|
+
def security_schemes
|
22
|
+
data.dig('components', 'securitySchemes')
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
28
26
|
|
29
|
-
|
27
|
+
def data
|
28
|
+
@data ||= if ['.json'].include?(File.extname(@path))
|
29
|
+
JsonReader.new(@path).read
|
30
|
+
elsif %w[.yaml .yml].include?(File.extname(@path))
|
31
|
+
YamlReader.new(@path).read
|
32
|
+
else
|
33
|
+
raise StandardError, 'OA3Reader does not support this format'
|
34
|
+
end
|
30
35
|
end
|
31
36
|
end
|
32
37
|
end
|
data/lib/readers/yaml_reader.rb
CHANGED
@@ -1,37 +1,60 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '
|
3
|
+
require_relative 'plugins/auth_validator_transformer'
|
4
4
|
|
5
5
|
module KrakendOpenAPI
|
6
6
|
# Transforms OpenAPI paths to KrakenD endpoints
|
7
7
|
class OA3ToKrakendTransformer
|
8
|
-
|
9
|
-
|
8
|
+
SCHEME_TYPES_WITH_ROLES = %w[openIdConnect oauth2].freeze
|
9
|
+
|
10
|
+
def initialize(spec, importer_config)
|
11
|
+
@spec = spec
|
10
12
|
@importer_config = importer_config
|
11
13
|
end
|
12
14
|
|
13
15
|
def transform_paths
|
14
|
-
@paths.map { |path, methods| transform_path(path, methods) }.flatten
|
16
|
+
@spec.paths.map { |path, methods| transform_path(path, methods) }.flatten
|
15
17
|
end
|
16
18
|
|
17
19
|
private
|
18
20
|
|
21
|
+
def oauth_scopes_for(securities)
|
22
|
+
return nil if securities.nil?
|
23
|
+
|
24
|
+
securities.map do |security|
|
25
|
+
security.filter_map do |name, scopes|
|
26
|
+
next nil unless oauth_security_scheme_names.include?(name)
|
27
|
+
|
28
|
+
scopes
|
29
|
+
end
|
30
|
+
end.flatten.uniq
|
31
|
+
end
|
32
|
+
|
33
|
+
def oauth_security_scheme_names
|
34
|
+
@spec.security_schemes.filter_map do |name, scheme|
|
35
|
+
next nil unless SCHEME_TYPES_WITH_ROLES.include?(scheme['type'])
|
36
|
+
|
37
|
+
name
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
19
41
|
def transform_path(path, methods)
|
20
42
|
methods.map { |method, operation| transform_method(path, method, operation) }
|
21
43
|
end
|
22
44
|
|
23
45
|
def transform_method(path, method, operation)
|
24
46
|
roles = operation['x-jwt-roles']&.length ? operation['x-jwt-roles'] : @importer_config['all_roles']
|
25
|
-
|
47
|
+
scopes = oauth_scopes_for(operation['security']) || oauth_scopes_for(@spec.security)
|
26
48
|
plugins = []
|
27
|
-
if
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
49
|
+
plugins << auth_validator_plugin(roles, scopes) if auth_validator_plugin_enabled?(roles, scopes)
|
50
|
+
endpoint = krakend_endpoint(path, method)
|
51
|
+
endpoint[:extra_config] = endpoint_extra_config(plugins) unless plugins.empty?
|
52
|
+
|
53
|
+
endpoint
|
54
|
+
end
|
33
55
|
|
34
|
-
|
56
|
+
def krakend_endpoint(path, method)
|
57
|
+
{
|
35
58
|
endpoint: path,
|
36
59
|
method: method.upcase,
|
37
60
|
output_encoding: @importer_config['defaults']&.dig('endpoint', 'output_encoding'),
|
@@ -39,16 +62,27 @@ module KrakendOpenAPI
|
|
39
62
|
input_query_strings: @importer_config['defaults']&.dig('endpoint', 'input_query_strings'),
|
40
63
|
backend: [{ url_pattern: path, encoding: @importer_config['defaults']&.dig('backend', 0, 'encoding') }.compact]
|
41
64
|
}.compact
|
65
|
+
end
|
42
66
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
67
|
+
def auth_validator_plugin_enabled?(roles, scopes)
|
68
|
+
@importer_config['defaults']&.dig('plugins', 'auth_validator') &&
|
69
|
+
(roles&.any? || scopes&.any?)
|
70
|
+
end
|
47
71
|
|
48
|
-
|
49
|
-
|
72
|
+
def auth_validator_plugin(roles, scopes)
|
73
|
+
Plugins::AuthValidatorTransformer
|
74
|
+
.new
|
75
|
+
.transform_to_hash(
|
76
|
+
roles: roles,
|
77
|
+
scopes: scopes,
|
78
|
+
config: @importer_config['defaults']['plugins']['auth_validator']
|
79
|
+
)
|
80
|
+
end
|
50
81
|
|
51
|
-
|
82
|
+
def endpoint_extra_config(plugins)
|
83
|
+
plugins.each_with_object({}) do |plugin, memo|
|
84
|
+
memo[plugin[:name].to_sym] = plugin[:value]
|
85
|
+
end
|
52
86
|
end
|
53
87
|
end
|
54
88
|
end
|
@@ -4,20 +4,15 @@ module KrakendOpenAPI
|
|
4
4
|
module Plugins
|
5
5
|
# Transforms Auth Validator plugin definition
|
6
6
|
class AuthValidatorTransformer
|
7
|
-
def transform_to_hash(
|
8
|
-
|
7
|
+
def transform_to_hash(config:, roles: [], scopes: [])
|
8
|
+
value = config.dup
|
9
|
+
|
10
|
+
value['roles'] = roles unless roles.nil? || roles.empty?
|
11
|
+
value['scopes'] = scopes unless scopes.nil? || scopes.empty?
|
9
12
|
|
10
13
|
{
|
11
14
|
name: 'auth/validator',
|
12
|
-
value:
|
13
|
-
'alg': config['alg'],
|
14
|
-
'jwk_url': config['jwk_url'],
|
15
|
-
'cache': config['cache'],
|
16
|
-
'operation_debug': config['operation_debug'],
|
17
|
-
'roles_key_is_nested': config['roles_key_is_nested'],
|
18
|
-
'roles_key': config['roles_key'],
|
19
|
-
'roles': roles
|
20
|
-
}.compact
|
15
|
+
value: value
|
21
16
|
}
|
22
17
|
end
|
23
18
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'json'
|
4
|
+
require 'yaml'
|
4
5
|
|
5
6
|
module KrakendOpenAPI
|
6
7
|
# Writes KrakenD configuration to a file
|
@@ -12,13 +13,18 @@ module KrakendOpenAPI
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def write
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
config = {
|
17
|
+
'$schema': 'https://www.krakend.io/schema/v3.json',
|
18
|
+
version: 3
|
19
|
+
}
|
20
|
+
|
21
|
+
config.merge!(
|
22
|
+
@importer_config.dig('defaults', 'base') || {}
|
23
|
+
)
|
24
|
+
|
25
|
+
config[:endpoints] = @endpoints
|
26
|
+
|
27
|
+
File.write(file_path, format(config))
|
22
28
|
end
|
23
29
|
|
24
30
|
def file_path
|
@@ -29,5 +35,28 @@ module KrakendOpenAPI
|
|
29
35
|
File.expand_path(@output_file_path, pwd)
|
30
36
|
end
|
31
37
|
end
|
38
|
+
|
39
|
+
def format(obj)
|
40
|
+
format = @importer_config['format']
|
41
|
+
pretty_output = !!@importer_config['pretty'] # rubocop:disable Style/DoubleNegation
|
42
|
+
|
43
|
+
if format == 'yaml'
|
44
|
+
YAML.dump(stringify(obj))
|
45
|
+
elsif pretty_output
|
46
|
+
JSON.pretty_generate(obj)
|
47
|
+
else
|
48
|
+
JSON.dump(obj)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def stringify(obj)
|
53
|
+
if obj.is_a?(Array)
|
54
|
+
obj.map { |v| stringify(v) } if obj.is_a?(Array)
|
55
|
+
elsif obj.is_a?(Hash)
|
56
|
+
obj.to_h { |k, v| [k.to_s, stringify(v)] }
|
57
|
+
else
|
58
|
+
obj
|
59
|
+
end
|
60
|
+
end
|
32
61
|
end
|
33
62
|
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.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Semenenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
description: Import endpoints from OpenAPI spec to KrakenD endpoint configuration.
|
28
28
|
Supports OpenAPI v3.0
|
29
29
|
email:
|
30
|
-
-
|
30
|
+
- den@densemenenko.com
|
31
31
|
executables:
|
32
32
|
- krakend-openapi-importer
|
33
33
|
extensions: []
|
@@ -35,6 +35,7 @@ extra_rdoc_files: []
|
|
35
35
|
files:
|
36
36
|
- ".github/workflows/main.yml"
|
37
37
|
- ".gitignore"
|
38
|
+
- ".rubocop.yml"
|
38
39
|
- ".ruby-version"
|
39
40
|
- Gemfile
|
40
41
|
- Gemfile.lock
|
@@ -55,12 +56,13 @@ files:
|
|
55
56
|
- lib/transformers/oa3_transformer.rb
|
56
57
|
- lib/transformers/plugins/auth_validator_transformer.rb
|
57
58
|
- lib/writers/krakend_writer.rb
|
58
|
-
homepage: https://
|
59
|
+
homepage: https://github.com/denblackstache/krakend-openapi-importer
|
59
60
|
licenses:
|
60
61
|
- MIT
|
61
62
|
metadata:
|
62
63
|
allowed_push_host: https://rubygems.org
|
63
|
-
|
64
|
+
rubygems_mfa_required: 'true'
|
65
|
+
homepage_uri: https://github.com/denblackstache/krakend-openapi-importer
|
64
66
|
source_code_uri: https://github.com/denblackstache/krakend-openapi-importer
|
65
67
|
post_install_message:
|
66
68
|
rdoc_options: []
|