skull_island 2.0.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/README.md +1 -1
- data/lib/skull_island/helpers/cli_erb.rb +2 -2
- data/lib/skull_island/helpers/resource.rb +16 -13
- data/lib/skull_island/resources/route.rb +7 -0
- data/lib/skull_island/version.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: eff79cef47f9764701711c87bef82cded9cc3b7e58b4a21bc245042dbb77600f
|
4
|
+
data.tar.gz: 6f433b14ac328bd48fba2c7eadfdeff256b5f1c97c3f298665c2f25fc1a14327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2422ea1ebd93c4b3f62c8b9229ca8bb8277abef46c036a79ac2a35fa7cd29e4c829a5eaea3df5917c74f1758ed73310f39580c7ce91617574e2127bd118c82e
|
7
|
+
data.tar.gz: 9b6026082b5d2811617cda731a4887eb1d54a89935f3c78a06ecce61a399b9b20d432613510428edab0e99372bcc5b4f359842f2ea4ccbc18fee7615bbb825e8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
skull_island (2.0.
|
4
|
+
skull_island (2.0.3)
|
5
5
|
deepsort (~> 0.4)
|
6
6
|
erubi (~> 1.8)
|
7
7
|
json (~> 2.1)
|
@@ -62,7 +62,7 @@ GEM
|
|
62
62
|
net-http-pipeline (1.0.1)
|
63
63
|
netrc (0.11.0)
|
64
64
|
parallel (1.19.1)
|
65
|
-
parser (2.7.0.
|
65
|
+
parser (2.7.0.3)
|
66
66
|
ast (~> 2.4.0)
|
67
67
|
pusher-client (0.6.2)
|
68
68
|
json
|
@@ -88,7 +88,7 @@ GEM
|
|
88
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
89
89
|
rspec-support (~> 3.9.0)
|
90
90
|
rspec-support (3.9.2)
|
91
|
-
rubocop (0.80.
|
91
|
+
rubocop (0.80.1)
|
92
92
|
jaro_winkler (~> 1.5.1)
|
93
93
|
parallel (~> 1.10)
|
94
94
|
parser (>= 2.7.0.1)
|
@@ -97,7 +97,7 @@ GEM
|
|
97
97
|
ruby-progressbar (~> 1.7)
|
98
98
|
unicode-display_width (>= 1.4.0, < 1.7)
|
99
99
|
ruby-progressbar (1.10.1)
|
100
|
-
simplecov (0.18.
|
100
|
+
simplecov (0.18.5)
|
101
101
|
docile (~> 1.1)
|
102
102
|
simplecov-html (~> 0.11)
|
103
103
|
simplecov-html (0.12.1)
|
@@ -123,7 +123,7 @@ GEM
|
|
123
123
|
unf_ext (0.0.7.6)
|
124
124
|
unicode-display_width (1.6.1)
|
125
125
|
websocket (1.2.8)
|
126
|
-
will_paginate (3.
|
126
|
+
will_paginate (3.3.0)
|
127
127
|
yard (0.9.24)
|
128
128
|
|
129
129
|
PLATFORMS
|
data/README.md
CHANGED
@@ -270,7 +270,7 @@ plugins:
|
|
270
270
|
service: "<%= lookup :service, 'search_api' %>"
|
271
271
|
```
|
272
272
|
|
273
|
-
All top-level keys (other than `version` and `project`) require an Array as a parameter, either by providing a list of entries or an empty Array (`[]`), or they can be omitted entirely which is the same as providing an empty Array. The above shows how to use the `lookup()` function to refer to another resource. This "looks up" the resource type (`service` in this case) by `name` (`search_api` in this case) and resolves its `id`. This function can also be used to lookup a `route` or `upstream` by its `name`, or a `consumer` by its `username`. Note that Kong itself doesn't _require_ `route` resources to have unique names, so you'll need to enforce that practice yourself for `lookup` to be useful for Routes.
|
273
|
+
All top-level keys (other than `version` and `project`) require an Array as a parameter, either by providing a list of entries or an empty Array (`[]`), or they can be omitted entirely which is the same as providing an empty Array. The above shows how to use the `lookup()` function to refer to another resource. This "looks up" the resource type (`service` in this case) by `name` (`search_api` in this case) and resolves its `id`. This function can also be used to lookup a `route` or `upstream` by its `name`, or a `consumer` by its `username`. Note that Kong itself doesn't _require_ `route` resources to have unique names, so you'll need to enforce that practice yourself for `lookup` to be useful for Routes. The `lookup` function also supports a third parameter to provide just the `id` value, rather than wrapping it in a key/value pair of `id: 9992...`. Simple call `lookup` like `lookup :service, 'search_api', true` to turn on this "raw id mode".
|
274
274
|
|
275
275
|
Note that while this configuration looks a lot like the [DB-less](https://docs.konghq.com/1.4.x/db-less-and-declarative-config/) configuration (and even may, at times, be interchangeable), this is merely a coincidence. **Skull Island doesn't support the DB-less mode for Kong.** This may potentially change in the future, but for now it is not a goal of this project.
|
276
276
|
|
@@ -105,19 +105,22 @@ module SkullIsland
|
|
105
105
|
# rubocop:enable Metrics/CyclomaticComplexity
|
106
106
|
# rubocop:enable Metrics/PerceivedComplexity
|
107
107
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
108
|
+
# Looks up IDs (and usually wraps them in a Hash)
|
109
|
+
def lookup(type, value, raw = false)
|
110
|
+
id_value = case type
|
111
|
+
when :consumer
|
112
|
+
Resources::Consumer.find(:username, value).id
|
113
|
+
when :route
|
114
|
+
Resources::Route.find(:name, value).id
|
115
|
+
when :service
|
116
|
+
Resources::Service.find(:name, value).id
|
117
|
+
when :upstream
|
118
|
+
Resources::Upstream.find(:name, value).id
|
119
|
+
else
|
120
|
+
raise Exceptions::InvalidArguments, "#{type} is not a valid lookup type"
|
121
|
+
end
|
122
|
+
|
123
|
+
raw ? id_value : { 'id' => id_value }
|
121
124
|
end
|
122
125
|
|
123
126
|
# ActiveRecord ActiveModel::Name compatibility method
|
@@ -20,6 +20,7 @@ module SkullIsland
|
|
20
20
|
property :strip_path, type: :boolean
|
21
21
|
property :preserve_host, type: :boolean
|
22
22
|
property :snis, validate: true
|
23
|
+
property :path_handling, validate: true
|
23
24
|
property :sources
|
24
25
|
property :destinations
|
25
26
|
property :service, validate: true, preprocess: true, postprocess: true
|
@@ -135,6 +136,12 @@ module SkullIsland
|
|
135
136
|
end
|
136
137
|
end
|
137
138
|
|
139
|
+
# Used to validate {#path_handling} on set
|
140
|
+
def validate_path_handling(value)
|
141
|
+
valid_values = %w[v0 v1]
|
142
|
+
valid_values.include?(value)
|
143
|
+
end
|
144
|
+
|
138
145
|
# Used to validate {#protocols} on set
|
139
146
|
def validate_protocols(value)
|
140
147
|
valid_protos = %w[http https tls tcp grpc grpcs]
|
data/lib/skull_island/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skull_island
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02
|
11
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deepsort
|