-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test against Kong 1.1, split /apis into /routes and /services
- Loading branch information
Showing
24 changed files
with
244 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module Kong | ||
module BelongsToService | ||
attr_accessor :service | ||
|
||
# Convert Service end point relative to Kong API resource | ||
def use_service_end_point | ||
self.api_end_point = "/services/#{self.service_id}#{self.class::API_END_POINT}" if self.service_id | ||
end | ||
|
||
# Get Service resource | ||
# @return [Kong::Service] | ||
def service | ||
@service ||= Service.find(self.service_id) | ||
end | ||
|
||
# Set Service resource | ||
# @param [Kong::Service] service | ||
def service=(service) | ||
@service = service | ||
self.service_id = service.id | ||
end | ||
|
||
# Set Service id | ||
# @param [String] id | ||
def service_id=(id) | ||
super(id) | ||
use_service_end_point | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Kong | ||
class Route | ||
include Base | ||
|
||
ATTRIBUTE_NAMES = %w( | ||
id name protocols methods hosts paths | ||
regex_priority strip_path preserve_host | ||
service_id tags | ||
).freeze | ||
API_END_POINT = '/routes/'.freeze | ||
|
||
## | ||
# @return [Array<Kong::Plugin>] | ||
def plugins | ||
Plugin.list({ route_id: self.id }) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Kong | ||
class Service | ||
include Base | ||
|
||
ATTRIBUTE_NAMES = %w( | ||
id name retries protocol host port path | ||
connect_timeout write_timeout upstream_read_timeout | ||
tags | ||
).freeze | ||
API_END_POINT = '/services/'.freeze | ||
|
||
## | ||
# @return [Array<Kong::Plugin>] | ||
def plugins | ||
Plugin.list({ service_id: self.id }) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Kong | ||
VERSION = '0.3.4'.freeze | ||
VERSION = '0.4.3'.freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.