skull_island 0.2.4 → 0.2.5
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 +5 -2
- data/lib/skull_island/cli.rb +4 -2
- data/lib/skull_island/resources/upstream.rb +1 -1
- 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: 7ae162b00d41479f3b316a7eee57bbb4139cdb24364016c8c9d86e97814cd5a8
|
4
|
+
data.tar.gz: '091baaeb7c97ffa277426aba9aae09f45134d9b7d001a69ff8ff862e28bb2273'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1453614d3ecf8b88f1c8e484b1d9f8a16ac52f90caf1996289677348f8bd4d31346ba8f8fc0abbfb7430042d170300ef80542265044331939657d4fc42f79c17
|
7
|
+
data.tar.gz: 217318107925b29eb979a10660c237d7687411c149ad97c2f54c88ffdcb154d3f76a3c2097dd5d9e872f7e7c38134ec44142babd8cc69106fc401aae534e3216
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -118,6 +118,7 @@ The import/export CLI functions produce YAML with support for embedded Ruby ([ER
|
|
118
118
|
```yaml
|
119
119
|
---
|
120
120
|
version: '0.14'
|
121
|
+
certificates: []
|
121
122
|
consumers:
|
122
123
|
- username: foo
|
123
124
|
custom_id: foo
|
@@ -127,6 +128,7 @@ consumers:
|
|
127
128
|
basic-auth:
|
128
129
|
- username: foo
|
129
130
|
password: bar
|
131
|
+
upstreams: []
|
130
132
|
services:
|
131
133
|
- name: apidocs
|
132
134
|
protocol: https
|
@@ -160,7 +162,6 @@ services:
|
|
160
162
|
regex_priority: 0
|
161
163
|
strip_path: true
|
162
164
|
preserve_host: false
|
163
|
-
upstreams: []
|
164
165
|
plugins:
|
165
166
|
- name: key-auth
|
166
167
|
enabled: true
|
@@ -176,7 +177,9 @@ plugins:
|
|
176
177
|
|
177
178
|
All top-level keys (other than `version`) require an Array as a parameter, either by providing a list of entries or 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.
|
178
179
|
|
180
|
+
While technically _any_ Ruby is valid, the following are pretty helpful for templating your YAML files:
|
179
181
|
|
182
|
+
* `ENV.fetch('VARIABLE_NAME', 'default value')` - This allows looking up the environment variable `VARIABLE_NAME` and using its value, or, if it isn't defined, it uses `default value` as the value. With this we could change `host: api.example.com` to `host: <%= ENV.fetch('API_HOST', 'api.example.com') %>`. With this, if `API_HOST` is provided, it'll use that, otherwise it will default to `api.example.com`.
|
180
183
|
|
181
184
|
## SDK Usage
|
182
185
|
|
@@ -275,7 +278,7 @@ my_consumer.username
|
|
275
278
|
Some resource types are related to others, such as `Routes` and `Services`:
|
276
279
|
|
277
280
|
```ruby
|
278
|
-
service = Resources::
|
281
|
+
service = Resources::Service.all.first
|
279
282
|
# => #<SkullIsland::Resources::Services:0x00007f9f201f6f44...
|
280
283
|
service.routes
|
281
284
|
# => #<SkullIsland::ResourceCollection:0x00007f9f1e569e1d...
|
data/lib/skull_island/cli.rb
CHANGED
@@ -27,9 +27,10 @@ module SkullIsland
|
|
27
27
|
output = { 'version' => '0.14' }
|
28
28
|
|
29
29
|
[
|
30
|
+
Resources::Certificate,
|
30
31
|
Resources::Consumer,
|
31
|
-
Resources::Service,
|
32
32
|
Resources::Upstream,
|
33
|
+
Resources::Service,
|
33
34
|
Resources::Plugin
|
34
35
|
].each { |clname| export_class(clname, output) }
|
35
36
|
|
@@ -64,9 +65,10 @@ module SkullIsland
|
|
64
65
|
# rubocop:enable Security/YAMLLoad
|
65
66
|
|
66
67
|
[
|
68
|
+
Resources::Certificate,
|
67
69
|
Resources::Consumer,
|
68
|
-
Resources::Service,
|
69
70
|
Resources::Upstream,
|
71
|
+
Resources::Service,
|
70
72
|
Resources::Plugin
|
71
73
|
].each { |clname| import_class(clname, input) }
|
72
74
|
end
|
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: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deepsort
|