krakend-openapi-importer 1.0.0 → 1.1.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/Gemfile.lock +1 -1
- data/README.md +13 -6
- data/lib/importer/version.rb +1 -1
- data/lib/transformers/oa3_transformer.rb +5 -1
- data/lib/writers/krakend_writer.rb +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: 42f8decc7a78765c173ba1fcbc56921b83e4b80f9e64528e2038b3a5582c57c1
|
4
|
+
data.tar.gz: 8cc805c646fd57bb4b4ff509c93d15ff1ef11fc44efdf2ba7b17c4187a47aeb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87882d563ba41ef98c9e8d989ee6386b1e4060a80c08a2fe208cec5c0c178734340f13148fad37613b5961e8be42f600c317a373fd8b07c37e91e0bbe2cade8e
|
7
|
+
data.tar.gz: cb38f67effdc5439ad893d3a39f2d0544307e1e487dd9f9fbae22b97906c0326dd27ec7be7521951c645b77c293af530ee041838af5035e55817f44037431322
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,8 @@ 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
|
+
* Supported Ruby versions: 2.7 and up
|
8
9
|
|
9
10
|
## Installation
|
10
11
|
|
@@ -31,10 +32,10 @@ Example config
|
|
31
32
|
|
32
33
|
```yaml
|
33
34
|
---
|
34
|
-
|
35
|
-
pretty:
|
36
|
-
|
37
|
-
|
35
|
+
format: "json" # can be 'json' or 'yaml', optional, defaults to 'json'
|
36
|
+
pretty: false # make JSON pretty, optional, defaults to false
|
37
|
+
output: "output.json" # output file name, optional, defaults to 'output.json'
|
38
|
+
all_roles: ["guest"] # fall back roles for auth validator plugin when operation 'x-jwt-roles` are not specified, optional
|
38
39
|
defaults:
|
39
40
|
base:
|
40
41
|
name: Example application
|
@@ -44,6 +45,7 @@ defaults:
|
|
44
45
|
input_query_strings: ["*"]
|
45
46
|
backend:
|
46
47
|
- encoding: "no-op"
|
48
|
+
host: [ "https://example.org" ]
|
47
49
|
plugins:
|
48
50
|
auth_validator:
|
49
51
|
alg: "RS256"
|
@@ -52,9 +54,14 @@ defaults:
|
|
52
54
|
operation_debug: true
|
53
55
|
roles_key: "realm_access.roles"
|
54
56
|
roles_key_is_nested: true
|
55
|
-
scopes_key: scopes # only needed when defining scopes in
|
57
|
+
scopes_key: scopes # only needed when defining scopes in OpenAPI spec
|
56
58
|
```
|
57
59
|
|
60
|
+
### Auth Validator plugin configuration
|
61
|
+
|
62
|
+
* You can specify custom roles for each OpenAPI [operation](https://swagger.io/specification/v3/#operation-object) using the `x-jwt-roles` [operation extension](https://swagger.io/specification/v3/#specification-extensions). If no `x-jwt-roles` are provided for an operation, the plugin will fall back to the default roles defined in the `all_roles` configuration.
|
63
|
+
* Importer supports `openIdConnect` and `oauth2` security schemes defined using [Security Requirement Objects](https://swagger.io/specification/v3/#security-requirement-object).
|
64
|
+
|
58
65
|
## Development
|
59
66
|
|
60
67
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/importer/version.rb
CHANGED
@@ -60,7 +60,11 @@ module KrakendOpenAPI
|
|
60
60
|
output_encoding: @importer_config['defaults']&.dig('endpoint', 'output_encoding'),
|
61
61
|
input_headers: @importer_config['defaults']&.dig('endpoint', 'input_headers'),
|
62
62
|
input_query_strings: @importer_config['defaults']&.dig('endpoint', 'input_query_strings'),
|
63
|
-
backend: [{
|
63
|
+
backend: [{
|
64
|
+
url_pattern: path,
|
65
|
+
encoding: @importer_config['defaults']&.dig('backend', 0, 'encoding'),
|
66
|
+
host: @importer_config['defaults']&.dig('backend', 0, 'host')
|
67
|
+
}.compact]
|
64
68
|
}.compact
|
65
69
|
end
|
66
70
|
|
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: 1.
|
4
|
+
version: 1.1.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: 2025-
|
11
|
+
date: 2025-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|