skull_island 0.2.4 → 0.2.5

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: 7b1ddcc4d39d09012c127f337b438f83c2e5397f8e05ecfb87d696872bd57544
4
- data.tar.gz: f096c22899ea60a9f35053b22f9cd628c2f7677dd3065417aee2d83404ba7f90
3
+ metadata.gz: 7ae162b00d41479f3b316a7eee57bbb4139cdb24364016c8c9d86e97814cd5a8
4
+ data.tar.gz: '091baaeb7c97ffa277426aba9aae09f45134d9b7d001a69ff8ff862e28bb2273'
5
5
  SHA512:
6
- metadata.gz: 100b4cd19f08fd8499e8c13fab6871faf1c635edc1968f34d280c56b0f1d665244e29dbe52ef4a583a6762ab8bdaa7f2e86a0717f06277a2d51f8a29316b0e29
7
- data.tar.gz: 21bf5f772e7be86408fae7b0e6791a2c698e8bc8b1aee6815d00a4cb5c30e4235b4720519fc99239044961d62ed08f69aabcb4d891faa981435fd5fcb642b8ce
6
+ metadata.gz: 1453614d3ecf8b88f1c8e484b1d9f8a16ac52f90caf1996289677348f8bd4d31346ba8f8fc0abbfb7430042d170300ef80542265044331939657d4fc42f79c17
7
+ data.tar.gz: 217318107925b29eb979a10660c237d7687411c149ad97c2f54c88ffdcb154d3f76a3c2097dd5d9e872f7e7c38134ec44142babd8cc69106fc401aae534e3216
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- skull_island (0.2.4)
4
+ skull_island (0.2.5)
5
5
  deepsort (~> 0.4)
6
6
  erubi (~> 1.8)
7
7
  json (~> 2.1)
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::Services.all.first
281
+ service = Resources::Service.all.first
279
282
  # => #<SkullIsland::Resources::Services:0x00007f9f201f6f44...
280
283
  service.routes
281
284
  # => #<SkullIsland::ResourceCollection:0x00007f9f1e569e1d...
@@ -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
@@ -90,7 +90,7 @@ module SkullIsland
90
90
  # TODO: do something with lazy requests...
91
91
 
92
92
  ResourceCollection.new(
93
- target_list_data[root].each do |record|
93
+ target_list_data[root].map do |record|
94
94
  UpstreamTarget.new(
95
95
  entity: record,
96
96
  lazy: false,
@@ -4,6 +4,6 @@ module SkullIsland
4
4
  VERSION = [
5
5
  0, # Major
6
6
  2, # Minor
7
- 4 # Patch
7
+ 5 # Patch
8
8
  ].join('.')
9
9
  end
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
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-14 00:00:00.000000000 Z
11
+ date: 2019-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deepsort