Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/ai_prompt_decorator_plugin
- Loading branch information
Showing
31 changed files
with
945 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
message: Enable `status_listen` on `127.0.0.1:8007` by default | ||
type: feature | ||
scope: Admin API |
3 changes: 3 additions & 0 deletions
3
changelog/unreleased/kong/standardize-redis-conifguration-acme.yml
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,3 @@ | ||
message: "**ACME**: Standardize redis configuration across plugins. The redis configuration right now follows common schema that is shared across other plugins." | ||
type: deprecation | ||
scope: Plugin |
4 changes: 4 additions & 0 deletions
4
changelog/unreleased/kong/support_net_src_dst_field_in_expression.yml
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,4 @@ | ||
message: | | ||
`net.src.*` and `net.dst.*` match fields are now accessible in HTTP routes defined using expressions. | ||
type: feature | ||
scope: Core |
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 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,23 @@ | ||
local function adapter(config_to_update) | ||
if config_to_update.storage == "redis" then | ||
config_to_update.storage_config.redis = { | ||
host = config_to_update.storage_config.redis.host, | ||
port = config_to_update.storage_config.redis.port, | ||
auth = config_to_update.storage_config.redis.password, | ||
database = config_to_update.storage_config.redis.database, | ||
ssl = config_to_update.storage_config.redis.ssl, | ||
ssl_verify = config_to_update.storage_config.redis.ssl_verify, | ||
ssl_server_name = config_to_update.storage_config.redis.server_name, | ||
namespace = config_to_update.storage_config.redis.extra_options.namespace, | ||
scan_count = config_to_update.storage_config.redis.extra_options.scan_count | ||
} | ||
|
||
return true | ||
end | ||
|
||
return false | ||
end | ||
|
||
return { | ||
adapter = adapter | ||
} |
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,41 @@ | ||
return { | ||
postgres = { | ||
up = [[ | ||
DO $$ | ||
BEGIN | ||
UPDATE plugins | ||
SET config = | ||
config | ||
#- '{storage_config,redis}' | ||
|| jsonb_build_object( | ||
'storage_config', | ||
(config -> 'storage_config') - 'redis' | ||
|| jsonb_build_object( | ||
'redis', | ||
jsonb_build_object( | ||
'host', config #> '{storage_config, redis, host}', | ||
'port', config #> '{storage_config, redis, port}', | ||
'password', config #> '{storage_config, redis, auth}', | ||
'username', config #> '{storage_config, redis, username}', | ||
'ssl', config #> '{storage_config, redis, ssl}', | ||
'ssl_verify', config #> '{storage_config, redis, ssl_verify}', | ||
'server_name', config #> '{storage_config, redis, ssl_server_name}', | ||
'timeout', config #> '{storage_config, redis, timeout}', | ||
'database', config #> '{storage_config, redis, database}' | ||
) || jsonb_build_object( | ||
'extra_options', | ||
jsonb_build_object( | ||
'scan_count', config #> '{storage_config, redis, scan_count}', | ||
'namespace', config #> '{storage_config, redis, namespace}' | ||
) | ||
) | ||
) | ||
) | ||
WHERE name = 'acme'; | ||
EXCEPTION WHEN UNDEFINED_COLUMN OR UNDEFINED_TABLE THEN | ||
-- Do nothing, accept existing state | ||
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ return { | |
"000_base_acme", | ||
"001_280_to_300", | ||
"002_320_to_330", | ||
"003_350_to_360", | ||
} |
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,28 @@ | ||
local redis_config_adapter = require "kong.plugins.acme.storage.config_adapters.redis" | ||
|
||
local function load_adapters() | ||
local adapters_mapping = { | ||
redis = redis_config_adapter | ||
} | ||
|
||
local function identity(config) | ||
return config | ||
end | ||
|
||
local default_value_mt = { __index = function() return identity end } | ||
|
||
setmetatable(adapters_mapping, default_value_mt) | ||
|
||
return adapters_mapping | ||
end | ||
|
||
local adapters = load_adapters() | ||
|
||
local function adapt_config(storage_type, storage_config) | ||
local adapter_fn = adapters[storage_type] | ||
return adapter_fn(storage_config[storage_type]) | ||
end | ||
|
||
return { | ||
adapt_config = adapt_config | ||
} |
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,16 @@ | ||
local function redis_config_adapter(conf) | ||
return { | ||
host = conf.host, | ||
port = conf.port, | ||
database = conf.database, | ||
auth = conf.password or conf.auth, -- allow conf.auth until 4.0 version | ||
ssl = conf.ssl, | ||
ssl_verify = conf.ssl_verify, | ||
ssl_server_name = conf.server_name or conf.ssl_server_name, -- allow conf.ssl_server_name until 4.0 version | ||
|
||
namespace = conf.extra_options.namespace or conf.namespace, -- allow conf.namespace until 4.0 version | ||
scan_count = conf.extra_options.scan_count or conf.scan_count, -- allow conf.scan_count until 4.0 version | ||
} | ||
end | ||
|
||
return redis_config_adapter |
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
Oops, something went wrong.