skull_island 0.14.0 → 0.14.1
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/lib/skull_island/resources/route.rb +9 -8
- 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: d2a3355226814eb0d485dbac28624003b323eb62b4a1116493ef5da234108930
|
4
|
+
data.tar.gz: 8fe0388fb91633ea0bd1eba39e98671bb3fe88bc691700573ed1a6daa7814e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e429af9e6768ad18c00e2b6e0f60844f2194eb32c627c7bb9cacfa4a0c282cb3069ed70c54a5be686c9c36a7b5f3882b0c6dfe34d5566a7c48a92b648894632
|
7
|
+
data.tar.gz: 320f1a3e376ac977d050460d978e6e838914932d759f82542bba0c797ae37c1ef2bb1f830f2c810f2843d0db91238074ac9c9f3a371a1e13eaa05beeb2d9c07e
|
data/Gemfile.lock
CHANGED
@@ -7,7 +7,6 @@ module SkullIsland
|
|
7
7
|
#
|
8
8
|
# @see https://docs.konghq.com/0.14.x/admin-api/#route-object Route API definition
|
9
9
|
class Route < Resource
|
10
|
-
property :name
|
11
10
|
property :methods
|
12
11
|
property :paths
|
13
12
|
property :protocols, validate: true
|
@@ -15,7 +14,8 @@ module SkullIsland
|
|
15
14
|
property :regex_priority, validate: true
|
16
15
|
property :strip_path, type: :boolean
|
17
16
|
property :preserve_host, type: :boolean
|
18
|
-
# The following are 1.0
|
17
|
+
# The following are 1.0+ only
|
18
|
+
# property :name
|
19
19
|
# property :snis
|
20
20
|
# property :sources
|
21
21
|
# property :destinations
|
@@ -25,13 +25,12 @@ module SkullIsland
|
|
25
25
|
|
26
26
|
# rubocop:disable Metrics/CyclomaticComplexity
|
27
27
|
# rubocop:disable Metrics/PerceivedComplexity
|
28
|
-
# rubocop:disable Metrics/AbcSize
|
29
28
|
def self.batch_import(data, verbose: false, test: false)
|
30
29
|
raise(Exceptions::InvalidArguments) unless data.is_a?(Array)
|
31
30
|
|
32
31
|
data.each_with_index do |rdata, index|
|
33
32
|
resource = new
|
34
|
-
resource.name = rdata['name']
|
33
|
+
# resource.name = rdata['name'] # 1.0+ only
|
35
34
|
resource.methods = rdata['methods'] if rdata['methods']
|
36
35
|
resource.paths = rdata['paths'] if rdata['paths']
|
37
36
|
resource.protocols = rdata['protocols'] if rdata['protocols']
|
@@ -45,7 +44,6 @@ module SkullIsland
|
|
45
44
|
end
|
46
45
|
# rubocop:enable Metrics/CyclomaticComplexity
|
47
46
|
# rubocop:enable Metrics/PerceivedComplexity
|
48
|
-
# rubocop:enable Metrics/AbcSize
|
49
47
|
|
50
48
|
# Provides a collection of related {Plugin} instances
|
51
49
|
def plugins
|
@@ -54,7 +52,7 @@ module SkullIsland
|
|
54
52
|
|
55
53
|
def export(options = {})
|
56
54
|
hash = {
|
57
|
-
'name' => name,
|
55
|
+
# 'name' => name, # 1.0+ only
|
58
56
|
'methods' => methods,
|
59
57
|
'paths' => paths,
|
60
58
|
'protocols' => protocols,
|
@@ -76,8 +74,11 @@ module SkullIsland
|
|
76
74
|
def modified_existing?
|
77
75
|
return false unless new?
|
78
76
|
|
79
|
-
# Find routes of the same
|
80
|
-
same_name_and_service = self.class.where(:
|
77
|
+
# Find routes of the same host, path, protocol, and service
|
78
|
+
same_name_and_service = self.class.where(:protocols, protocols)
|
79
|
+
.and(:hosts, hosts)
|
80
|
+
.and(:paths, paths)
|
81
|
+
.and(:service, service)
|
81
82
|
|
82
83
|
existing = same_name_and_service.size == 1 ? same_name_and_service.first : nil
|
83
84
|
|
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.14.
|
4
|
+
version: 0.14.1
|
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-
|
11
|
+
date: 2019-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deepsort
|