skull_island 1.4.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +21 -18
- data/README.md +9 -9
- data/lib/skull_island/cli.rb +5 -5
- data/lib/skull_island/helpers/migration.rb +17 -1
- data/lib/skull_island/resources/plugin.rb +1 -1
- data/lib/skull_island/version.rb +3 -3
- data/lib/skull_island.rb +4 -3
- 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: 00a7b4f233be82c0837c704cc2db5e07ede909632c2e54e413962f4343908974
|
4
|
+
data.tar.gz: 28589bf89713ddc2a039b861d7a1290677b6c69b5bdfe2f5a7ea62bce05fa52e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2530b37d2f914b1f6c6c419fa9b0c8dfb39dd9c760c51f0135bc9267eea4aab94ea3e8ae1c6058731356125a63ca1aafe5a6e97ac74ad5feb440849a28bb45b
|
7
|
+
data.tar.gz: c5231a55b789eb6cd602f34c7643585a8142adb81f722e96a805b0b91509d16f05df7708f811d61cfa6b76ce67dfbb0c898506b014c7395634a40c4f95808968
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
skull_island (
|
4
|
+
skull_island (2.0.0)
|
5
5
|
deepsort (~> 0.4)
|
6
6
|
erubi (~> 1.8)
|
7
7
|
json (~> 2.1)
|
@@ -15,14 +15,14 @@ GEM
|
|
15
15
|
specs:
|
16
16
|
addressable (2.4.0)
|
17
17
|
ast (2.4.0)
|
18
|
-
backports (3.
|
18
|
+
backports (3.16.1)
|
19
19
|
coveralls (0.7.1)
|
20
20
|
multi_json (~> 1.3)
|
21
21
|
rest-client
|
22
22
|
simplecov (>= 0.7)
|
23
23
|
term-ansicolor
|
24
24
|
thor
|
25
|
-
deepsort (0.4.
|
25
|
+
deepsort (0.4.3)
|
26
26
|
diff-lcs (1.3)
|
27
27
|
docile (1.3.2)
|
28
28
|
domain_name (0.5.20190701)
|
@@ -30,11 +30,11 @@ GEM
|
|
30
30
|
erubi (1.9.0)
|
31
31
|
ethon (0.12.0)
|
32
32
|
ffi (>= 1.3.0)
|
33
|
-
faraday (0.17.
|
33
|
+
faraday (0.17.3)
|
34
34
|
multipart-post (>= 1.2, < 3)
|
35
|
-
faraday_middleware (0.
|
35
|
+
faraday_middleware (0.14.0)
|
36
36
|
faraday (>= 0.7.4, < 1.0)
|
37
|
-
ffi (1.
|
37
|
+
ffi (1.12.2)
|
38
38
|
gh (0.15.1)
|
39
39
|
addressable (~> 2.4.0)
|
40
40
|
backports
|
@@ -52,7 +52,7 @@ GEM
|
|
52
52
|
addressable (~> 2.3)
|
53
53
|
linguistics (2.1.0)
|
54
54
|
loggability (~> 0.11)
|
55
|
-
loggability (0.
|
55
|
+
loggability (0.15.1)
|
56
56
|
mime-types (3.3.1)
|
57
57
|
mime-types-data (~> 3.2015)
|
58
58
|
mime-types-data (3.2019.1009)
|
@@ -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.2)
|
66
66
|
ast (~> 2.4.0)
|
67
67
|
pusher-client (0.6.2)
|
68
68
|
json
|
@@ -74,6 +74,7 @@ GEM
|
|
74
74
|
http-cookie (>= 1.0.2, < 2.0)
|
75
75
|
mime-types (>= 1.16, < 4.0)
|
76
76
|
netrc (~> 0.8)
|
77
|
+
rexml (3.2.4)
|
77
78
|
rspec (3.9.0)
|
78
79
|
rspec-core (~> 3.9.0)
|
79
80
|
rspec-expectations (~> 3.9.0)
|
@@ -83,27 +84,29 @@ GEM
|
|
83
84
|
rspec-expectations (3.9.0)
|
84
85
|
diff-lcs (>= 1.2.0, < 2.0)
|
85
86
|
rspec-support (~> 3.9.0)
|
86
|
-
rspec-mocks (3.9.
|
87
|
+
rspec-mocks (3.9.1)
|
87
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
88
89
|
rspec-support (~> 3.9.0)
|
89
90
|
rspec-support (3.9.2)
|
90
|
-
rubocop (0.
|
91
|
+
rubocop (0.80.0)
|
91
92
|
jaro_winkler (~> 1.5.1)
|
92
93
|
parallel (~> 1.10)
|
93
|
-
parser (>= 2.
|
94
|
+
parser (>= 2.7.0.1)
|
94
95
|
rainbow (>= 2.2.2, < 4.0)
|
96
|
+
rexml
|
95
97
|
ruby-progressbar (~> 1.7)
|
96
98
|
unicode-display_width (>= 1.4.0, < 1.7)
|
97
99
|
ruby-progressbar (1.10.1)
|
98
|
-
simplecov (0.
|
100
|
+
simplecov (0.18.4)
|
99
101
|
docile (~> 1.1)
|
100
|
-
|
101
|
-
|
102
|
-
|
102
|
+
simplecov-html (~> 0.11)
|
103
|
+
simplecov-html (0.12.1)
|
104
|
+
sync (0.5.0)
|
103
105
|
term-ansicolor (1.7.1)
|
104
106
|
tins (~> 1.0)
|
105
107
|
thor (0.20.3)
|
106
|
-
tins (1.
|
108
|
+
tins (1.24.1)
|
109
|
+
sync
|
107
110
|
travis (1.8.10)
|
108
111
|
backports
|
109
112
|
faraday (~> 0.9)
|
@@ -118,10 +121,10 @@ GEM
|
|
118
121
|
unf (0.1.4)
|
119
122
|
unf_ext
|
120
123
|
unf_ext (0.0.7.6)
|
121
|
-
unicode-display_width (1.6.
|
124
|
+
unicode-display_width (1.6.1)
|
122
125
|
websocket (1.2.8)
|
123
126
|
will_paginate (3.2.1)
|
124
|
-
yard (0.9.
|
127
|
+
yard (0.9.24)
|
125
128
|
|
126
129
|
PLATFORMS
|
127
130
|
ruby
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Skull Island
|
2
2
|
|
3
|
-
A full-featured SDK for [Kong](https://konghq.com/kong/)
|
3
|
+
A full-featured SDK for [Kong](https://konghq.com/kong/) 2.0.x (with support for migrating from 0.14.x, 1.1.x, 1.2.x, 1.4.x, and 1.5.x). Note that this is unofficial (meaning this project is in no way officially endorsed, recommended, or related to Kong [as a company](https://konghq.com/) or an [open-source project](https://github.com/Kong/kong)). It is also in no way related to the [pet toy company](https://www.kongcompany.com/) by the same name (but hopefully that was obvious).
|
4
4
|
|
5
5
|
![Gem](https://img.shields.io/gem/v/skull_island)
|
6
6
|
![Travis (.org)](https://img.shields.io/travis/jgnagy/skull_island)
|
@@ -30,7 +30,7 @@ gem install skull_island
|
|
30
30
|
Or add this to your Gemfile:
|
31
31
|
|
32
32
|
```ruby
|
33
|
-
gem 'skull_island', '~>
|
33
|
+
gem 'skull_island', '~> 2.0'
|
34
34
|
```
|
35
35
|
|
36
36
|
Or add this to your .gemspec:
|
@@ -38,7 +38,7 @@ Or add this to your .gemspec:
|
|
38
38
|
```ruby
|
39
39
|
Gem::Specification.new do |spec|
|
40
40
|
# ...
|
41
|
-
spec.add_runtime_dependency 'skull_island', '~>
|
41
|
+
spec.add_runtime_dependency 'skull_island', '~> 2.0'
|
42
42
|
# ...
|
43
43
|
end
|
44
44
|
```
|
@@ -149,17 +149,17 @@ When using the `project` feature of Skull Island, the CLI tool will automaticall
|
|
149
149
|
|
150
150
|
### Migrating
|
151
151
|
|
152
|
-
With Skull Island, it is possible to migrate a configuration from a 0.14.x, 1.1.x, or 1.
|
152
|
+
With Skull Island, it is possible to migrate a configuration from a 0.14.x, 1.1.x, 1.2.x, 1.4.x, or 1.5.x gateway to the most recent compatible gateway. If you have a previous export, you can just run `skull_island migrate /path/to/export.yml` and you'll receive a 2.0 compatible config on standard out. If you'd prefer, you can have that config written to a file as well (just like the export command) like so:
|
153
153
|
|
154
154
|
```sh
|
155
155
|
skull_island migrate /path/to/export.yml /output/location/migrated.yml
|
156
156
|
```
|
157
157
|
|
158
|
-
While this hasn't been heavily tested for all possible use-cases, any configuration generated or usable by the `'~> 0.14'
|
158
|
+
While this hasn't been heavily tested for all possible use-cases, any configuration generated or usable by the `'~> 0.14'`, `'~> 1.2'`, or `~> 1.4` version of this gem should safely convert using the migration command. This tool also makes no guarantees about plugin functionality, configuration compatibility across versions, or that the same plugins are installed and available in your newer gateway. It should go without saying that you should **test and confirm** that all of your functionality was successfully migrated.
|
159
159
|
|
160
160
|
If you don't have a previous export, you'll need to install an older version of this gem using something like `gem install --version '~> 0.14' skull_island`, then perform an `export`, then you can switch back to the latest version of the gem for migrating and importing.
|
161
161
|
|
162
|
-
While it would be possible to make migration _automatic_ for the `import` command, `skull_island` intentionally doesn't do this to avoid the appearance that the config is losslessly compatible across versions. In reality, the newer config version has additional features (like tagging) that are used heavily by skull_island. It makes sense to this author to maintain the migration component and the normal functionality as distinct features to encourage the use of the newer capabilities in 1.1 and beyond. That said, Skull Island does allow 1.1 and 1.
|
162
|
+
While it would be possible to make migration _automatic_ for the `import` command, `skull_island` intentionally doesn't do this to avoid the appearance that the config is losslessly compatible across versions. In reality, the newer config version has additional features (like tagging) that are used heavily by skull_island. It makes sense to this author to maintain the migration component and the normal functionality as distinct features to encourage the use of the newer capabilities in 1.1 and beyond. That said, Skull Island does allow 1.1, 1.2, and 1.4 version configurations to be applied to 2.0 gateways, but not the opposite.
|
163
163
|
|
164
164
|
### Reset A Gateway
|
165
165
|
|
@@ -188,7 +188,7 @@ If you're wondering what version of `skull_island` is installed, use:
|
|
188
188
|
```sh
|
189
189
|
$ skull_island version
|
190
190
|
|
191
|
-
SkullIsland Version:
|
191
|
+
SkullIsland Version: 2.0.0
|
192
192
|
```
|
193
193
|
|
194
194
|
### File Format
|
@@ -197,7 +197,7 @@ The import/export/migrate CLI functions produce YAML with support for embedded R
|
|
197
197
|
|
198
198
|
```yaml
|
199
199
|
---
|
200
|
-
version: '
|
200
|
+
version: '2.0'
|
201
201
|
project: FooV2
|
202
202
|
certificates: []
|
203
203
|
ca_certificates:
|
@@ -398,7 +398,7 @@ service.routes.size
|
|
398
398
|
# => 4
|
399
399
|
```
|
400
400
|
|
401
|
-
From here, the SDK mostly wraps the attributes described in the [Kong API Docs](https://docs.konghq.com/
|
401
|
+
From here, the SDK mostly wraps the attributes described in the [Kong API Docs](https://docs.konghq.com/2.0.x/admin-api/). For simplicity, I'll go over the resource types and attributes this SDK supports manipulating. Rely on the API documentation to determine which attributes are required and under which conditions.
|
402
402
|
|
403
403
|
#### CA Certificates
|
404
404
|
|
data/lib/skull_island/cli.rb
CHANGED
@@ -30,7 +30,7 @@ module SkullIsland
|
|
30
30
|
|
31
31
|
validate_server_version
|
32
32
|
|
33
|
-
output = { 'version' => '
|
33
|
+
output = { 'version' => '2.0' }
|
34
34
|
output['project'] = options['project'] if options['project']
|
35
35
|
|
36
36
|
[
|
@@ -191,7 +191,7 @@ module SkullIsland
|
|
191
191
|
end
|
192
192
|
|
193
193
|
def validate_config_version(version)
|
194
|
-
if version && ['1.1', '1.2', '1.4'].include?(version)
|
194
|
+
if version && ['1.1', '1.2', '1.4', '1.5', '2.0'].include?(version)
|
195
195
|
validate_server_version
|
196
196
|
elsif version && ['0.14', '1.0'].include?(version)
|
197
197
|
warn '[CRITICAL] Config version is too old. Try `migrate` instead of `import`.'
|
@@ -203,17 +203,17 @@ module SkullIsland
|
|
203
203
|
end
|
204
204
|
|
205
205
|
def validate_migrate_version(version)
|
206
|
-
if version && ['0.14', '1.0', '1.1', '1.2'].include?(version)
|
206
|
+
if version && ['0.14', '1.0', '1.1', '1.2', '1.4', '1.5'].include?(version)
|
207
207
|
true
|
208
208
|
else
|
209
|
-
warn '[CRITICAL] Config version must be 0.14 or 1.0-1.
|
209
|
+
warn '[CRITICAL] Config version must be 0.14 or 1.0-1.5 for migration.'
|
210
210
|
exit 4
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
214
214
|
def validate_server_version
|
215
215
|
server_version = SkullIsland::APIClient.about_service['version']
|
216
|
-
if server_version.match?(/^
|
216
|
+
if server_version.match?(/^2.0/)
|
217
217
|
true
|
218
218
|
else
|
219
219
|
warn '[CRITICAL] Server version mismatch!'
|
@@ -8,7 +8,11 @@ module SkullIsland
|
|
8
8
|
if config['version'] == '0.14'
|
9
9
|
migrate_config migrate_0_14_to_1_1(config)
|
10
10
|
elsif ['1.0', '1.1', '1.2', '1.3'].include?(config['version'])
|
11
|
-
migrate_1_1_to_1_4(config)
|
11
|
+
migrate_config migrate_1_1_to_1_4(config)
|
12
|
+
elsif config['version'] == '1.4'
|
13
|
+
migrate_config migrate_1_4_to_1_5(config)
|
14
|
+
elsif config['version'] == '1.5'
|
15
|
+
migrate_1_5_to_2_0(config)
|
12
16
|
else
|
13
17
|
false # Just return false if it can't be migrated
|
14
18
|
end
|
@@ -37,6 +41,18 @@ module SkullIsland
|
|
37
41
|
new_config['version'] = '1.4'
|
38
42
|
new_config
|
39
43
|
end
|
44
|
+
|
45
|
+
def migrate_1_4_to_1_5(config)
|
46
|
+
new_config = config.dup
|
47
|
+
new_config['version'] = '1.5'
|
48
|
+
new_config
|
49
|
+
end
|
50
|
+
|
51
|
+
def migrate_1_5_to_2_0(config)
|
52
|
+
new_config = config.dup
|
53
|
+
new_config['version'] = '2.0'
|
54
|
+
new_config
|
55
|
+
end
|
40
56
|
end
|
41
57
|
end
|
42
58
|
end
|
data/lib/skull_island/version.rb
CHANGED
data/lib/skull_island.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Core Extensions
|
4
|
+
require 'core_extensions/string/transformations'
|
5
|
+
String.include CoreExtensions::String::Transformations
|
6
|
+
|
3
7
|
# Standard Library Requirements
|
4
8
|
require 'date'
|
5
9
|
require 'digest'
|
@@ -18,9 +22,6 @@ require 'will_paginate'
|
|
18
22
|
require 'will_paginate/array'
|
19
23
|
|
20
24
|
# Internal Requirements
|
21
|
-
require 'core_extensions/string/transformations'
|
22
|
-
String.include CoreExtensions::String::Transformations
|
23
|
-
|
24
25
|
require 'skull_island/version'
|
25
26
|
require 'skull_island/api_exception'
|
26
27
|
require 'skull_island/exceptions/ambiguous_find'
|
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:
|
4
|
+
version: 2.0.0
|
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-
|
11
|
+
date: 2020-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deepsort
|