Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 86de704
Author: Murillo <103451714+gruceo@users.noreply.github.com>
Date:   Wed Apr 20 20:18:14 2022 -0300

    fix(cp) proper error handling for export_deflated_reconfigure_payload

commit 612648c
Author: Murillo <103451714+gruceo@users.noreply.github.com>
Date:   Wed Apr 13 11:28:29 2022 -0300

    fix(wrpc) do a pcall for all export_deflated_reconfigure_payload calls

    We are already wrapping some calls to
    `export_deflated_reconfigure_payload()` inside a pcall in the
    `wrpc_control_plane.lua` file. This change is doing a pcall in all the
    remaining calls to `export_deflated_reconfigure_payload()` in this file
    to avoid the CP crash whenever we find errors during initialization of
    modules for example.

commit 3c89fa1
Author: Murillo <103451714+gruceo@users.noreply.github.com>
Date:   Mon Apr 11 16:05:09 2022 -0300

    fix(cp) do a pcall for all calls to export_deflated_reconfigure_payload

    We are already wrapping some calls to
    `export_deflated_reconfigure_payload()` inside a pcall in the
    `control_plane.lua` file. This change is doing a pcall in all the
    remaining calls to `export_deflated_reconfigure_payload()` in this file
    to avoid the CP crash whenever we find errors during initialization of
    modules for example.

commit 6f20f2f
Author: Enrique García Cota <kikito@gmail.com>
Date:   Fri Apr 22 15:18:24 2022 +0200

    tests(hybrid) mark test as flaky (#8713)

commit fb8aa2d
Author: Suika <100666470+Suika-Kong@users.noreply.github.com>
Date:   Fri Apr 22 01:24:15 2022 +0800

    fix(pdk) ignore user set Tranfer-Encoding (#8698)

commit 31ca6ea
Author: Colin Hutchinson <hutchic@users.noreply.github.com>
Date:   Thu Apr 21 11:33:23 2022 +0000

    chore(release): cleanup the Jenkins release logic (#8706)

commit 39dd728
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Thu Apr 21 13:32:50 2022 +0300

    feat(clustering) atomic export of declarative config with Postgres

    This minimizes the possibilities of inconsistencies in exported config, especially under high Admin API update traffic.

commit 579537b
Author: Colin Hutchinson <hutchic@users.noreply.github.com>
Date:   Wed Apr 20 18:00:04 2022 +0000

    Revert "feat(dao) use `cache_key` for target uniqueness detection" (#8705)

    This reverts commit 9eba2a1.

commit a05cc4c
Author: Vinicius Mignot <vinicius.mignot@gmail.com>
Date:   Tue Apr 19 16:42:12 2022 -0300

    docs(CHANGELOG) added fix entry

commit 9a65902
Author: Vinicius Mignot <vinicius.mignot@gmail.com>
Date:   Tue Apr 19 15:41:43 2022 -0300

    fix(balancer) do not reschedule resolve timer when reloading

commit f6aae6f
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Tue Apr 19 17:56:27 2022 +0300

    chore(deps) bump luarocks 3.8.0 to 3.9.0 (#8700)

    * `builtin` build mode now always respects CC, CFLAGS and LDFLAGS
    * Check that lua.h version matches the desired Lua version
    * Check that the version of the Lua C library matches the desired Lua version
    * Fixed deployment of non-wrapped binaries
    * Fixed crash when `--lua-version` option is malformed
    * Fixed help message for `--pin` option
    * Unix: use native methods and don't always rely on $USER to determine user
    * Windows: use native CLI tooling more
    * macOS: support .tbd extension when checking for libraries
    * macOS: add XCode SDK path to search paths
    * macOS: add best-effort heuristic for library search using Homebrew paths
    * macOS: avoid quoting issues with LIBFLAG
    * macOS: deployment target is now 11.0 on macOS 11+
    * added DragonFly BSD support
    * LuaRocks test suite now runs on Lua 5.4 and LuaJIT
    * Internal dependencies of standalone LuaRocks executable were bumped

commit eb9a8ba
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Mon Apr 11 16:35:08 2022 +0300

    perf(conf) localize variables needed for configuration parsing

    Just localizes some variable for a faster configuration parsing, and tidier
    code.

commit 951b93f
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Mon Apr 11 15:57:22 2022 +0300

    fix(conf) properly support vault configurations with process secrets

    Default vault configurations can be configured with Kong configuration.

    For example using environment variables:

    - `KONG_VAULT_ENV_PREFIX=vault_`
    - `KONG_VAULT_HCV_TOKEN=xxx`

    Previously these settings were not honoured when kong configuration references
    were dereferenced. This fixes that issue.

commit 3d583c8
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Mon Apr 11 12:49:35 2022 +0300

    refactor(pdk) vault pdk to be more like rest of the pdk modules

    Refactor Vault PDK to follow other Kong PDK modules. This means that functions
    are created inside `.new` function. This has benefit of being able to access
    up-value `self`, which means that no direct references to global `kong` is needed.

    In general, it makes testing and mocking easier too.

    I need this so I can pass some initial configuration very early on when Kong does
    process secrets resolving of Kong configuration references.

commit 5156596
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Fri Apr 8 16:33:33 2022 +0300

    feat(vaults) store dao references in $refs (needed for rotation)

    When there are references used in dao fields with `referenceable=true`,
    Kong replaces the references with values when the data is read
    (excluding admin api and control planes). When Kong replaces the reference,
    it is basically lost, and thus the automatic secret rotation cannot be
    implemented. This commit stores the references on returned entities to
    `"$refs"` property:

    ```
    local certificate = kong.db.certificates:select(...)
    -- the possible reference can be found here:
    print(certificate["$refs"].key)
    ```

    There will be helper functions so `"$refs"` property is not intended to
    end users.

commit ac69743
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Fri Apr 8 16:00:49 2022 +0300

    fix(vaults) do not leak resolved vault references to .kong_env file

    When Kong prepares a `prefix` directory, it also stores current environment
    related to Kong in file called `.kong_env`. As Kong resolves the Vault
    references when it starts, the resolved values got leaked to `.kong_env`
    file. This was partly because for `vaults-beta` we didn't yet implement
    secret rotation, and we decided to also not keep the references around
    when they were resolved. Not that we have added the `"$refs"` property
    to `kong.configuration`, we can replace the values of configuration with
    the references before we write the `.kong_env` file.

    This commit fixes that.

commit 7f13cbc
Author: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Date:   Fri Apr 8 15:53:29 2022 +0300

    feat(vaults) store configuration references in $refs (needed for rotation and .kong_env cleanup)

    Kong vault references like `{vault://env/my-env-var}` when used in Kong configuration are replaced
    with actual secrets. This makes it hard to implement secret rotation as the reference is lost when
    it is replaced. This commit stores the original references on a side:

    ```lua
    kong.configuration[$refs][<key>] = <reference>
    ```

commit bffa4af
Author: Mayo <i@shoujo.io>
Date:   Tue Apr 19 17:57:40 2022 +0800

    chore(ci) changelog label

    Any PR includes a changelog will add a “core/docs” label which is unnecessary, this PR added an extra label 'changelog' to detect changelog file changes.

commit 9eba2a1
Author: yankun-li-kong <77371186+yankun-li-kong@users.noreply.github.com>
Date:   Tue Apr 19 19:27:23 2022 +0900

    feat(dao) use `cache_key` for target uniqueness detection

    Add new `cache_key(upstream, target)` in targets table for atomic
    uniqueness detection.
    Delete useless targets uniqueness detection functions.
    Targets API returns `409` when creating/updating delicate targets.
    Add migration functions to add `cache_key` column,
    delete duplicate targets and add `cache_key` for existing targets.

    Co-authored-by: Mayo <i@shoujo.io>

commit d7a8e66
Author: Mayo <i@shoujo.io>
Date:   Tue Apr 19 17:36:33 2022 +0800

    fix(ldap-auth) free internal pointer after covert to lua string (#8696)

commit d4bdae5
Author: Mayo <i@shoujo.io>
Date:   Tue Apr 19 12:08:09 2022 +0800

    refactor(ldap-auth) openssl ffi based asn1 parser/decoder (#8663)

    Replace asn1 parser/decoder with openssl ffi based functions.

commit 79f362d
Author: Wheeler Law <whelderwheels613@gmail.com>
Date:   Mon Apr 18 04:51:32 2022 -0500

    chore(CODEOWNERS) add `CODEOWNERS` file to the repo
  • Loading branch information
ADD-SP committed Apr 24, 2022
1 parent c3a8448 commit b9f5b65
Show file tree
Hide file tree
Showing 27 changed files with 1,074 additions and 955 deletions.
5 changes: 4 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ core/db/migrations:
core/db:
- any: ['kong/db/**/*', '!kong/db/migrations/**/*']

changelog:
- CHANGELOG.md

core/docs:
- '**/*.md'
- any: ['**/*.md', '!CHANGELOG.md']
- 'kong/autodoc/**/*'

core/language/go:
Expand Down
2 changes: 1 addition & 1 deletion .requirements
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ KONG_CONFLICTS=kong-enterprise-edition
KONG_LICENSE="ASL 2.0"

RESTY_VERSION=1.19.9.1
RESTY_LUAROCKS_VERSION=3.8.0
RESTY_LUAROCKS_VERSION=3.9.0
RESTY_OPENSSL_VERSION=1.1.1n
RESTY_PCRE_VERSION=8.45
RESTY_LMDB_VERSION=master
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@

## Unreleased

### Fixes

#### PDK

- `pdk.response.set_header()`, `pdk.response.set_headers()`, `pdk.response.exit()` now ignore and emit warnings for manually set `Transfer-Encoding` headers.
[#8698](https://github.com/Kong/kong/pull/8698)

### Breaking Changes

#### Admin API
Expand All @@ -72,6 +79,8 @@
method now. [#8596](https://github.com/Kong/kong/pull/8596). If you have
scripts that depend on it being `POST`, these scripts will need to be updated
when updating to Kong 3.0.
- Insert and update operations on duplicated target entities returns 409.
[#8179](https://github.com/Kong/kong/pull/8179)

#### PDK

Expand Down Expand Up @@ -113,7 +122,9 @@
- Bumped inspect from 3.1.2 to 3.1.3
[#8589](https://github.com/Kong/kong/pull/8589)
- Bumped resty.acme from 0.7.2 to 0.8.0
[#8680](https://github.com/Kong/kong/pull/8680
[#8680](https://github.com/Kong/kong/pull/8680)
- Bumped luarocks from 3.8.0 to 3.9.0
[#8700](https://github.com/Kong/kong/pull/8700)

### Additions

Expand Down Expand Up @@ -144,6 +155,8 @@
- Fix issue where the Go plugin server instance would not be updated after
a restart (e.g., upon a plugin server crash).
[#8547](https://github.com/Kong/kong/pull/8547)
- Fixed an issue on trying to reschedule the DNS resolving timer when Kong was
being reloaded. [#8702](https://github.com/Kong/kong/pull/8702)

#### Plugins

Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Kong/gateway
145 changes: 23 additions & 122 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pipeline {
}
}
parallel {
stage('AmazonLinux') {
stage('RPM') {
agent {
node {
label 'bionic'
Expand All @@ -66,168 +66,69 @@ pipeline {
environment {
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
AWS_ACCESS_KEY = credentials('AWS_ACCESS_KEY')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'PACKAGE_TYPE=rpm RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=2 make release'
}
}
stage('src & Alpine') {
agent {
node {
label 'bionic'
}
}
environment {
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
AWS_ACCESS_KEY = credentials('AWS_ACCESS_KEY')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'PACKAGE_TYPE=src RESTY_IMAGE_BASE=src make release'
sh 'PACKAGE_TYPE=apk RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3.14 CACHE=false DOCKER_MACHINE_ARM64_NAME="kong-"`cat /proc/sys/kernel/random/uuid` make release'

}
}
stage('RedHat') {
agent {
node {
label 'bionic'
}
}
environment {
PACKAGE_TYPE = 'rpm'
RESTY_IMAGE_BASE = 'rhel'
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
PRIVATE_KEY_FILE = credentials('kong.private.gpg-key.asc')
PRIVATE_KEY_PASSPHRASE = credentials('kong.private.gpg-key.asc.password')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'cp $PRIVATE_KEY_FILE ../kong-build-tools/kong.private.gpg-key.asc'
sh 'RESTY_IMAGE_TAG=7 make release'
sh 'RESTY_IMAGE_TAG=8 make release'
}
}
stage('CentOS') {
agent {
node {
label 'bionic'
}
}
environment {
PACKAGE_TYPE = 'rpm'
RESTY_IMAGE_BASE = 'centos'
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
PACKAGE_TYPE = "rpm"
PRIVATE_KEY_FILE = credentials('kong.private.gpg-key.asc')
PRIVATE_KEY_PASSPHRASE = credentials('kong.private.gpg-key.asc.password')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'cp $PRIVATE_KEY_FILE ../kong-build-tools/kong.private.gpg-key.asc'
sh 'RESTY_IMAGE_TAG=7 make release'
sh 'RESTY_IMAGE_TAG=8 make release'
sh 'make RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=2 release'
sh 'make RESTY_IMAGE_BASE=centos RESTY_IMAGE_TAG=7 release'
sh 'make RESTY_IMAGE_BASE=centos RESTY_IMAGE_TAG=8 release'
sh 'make RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=7 release'
sh 'make RESTY_IMAGE_BASE=rhel RESTY_IMAGE_TAG=8 release'
}
}
stage('Debian OldStable') {
stage('DEB') {
agent {
node {
label 'bionic'
}
}
environment {
PACKAGE_TYPE = 'deb'
RESTY_IMAGE_BASE = 'debian'
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'RESTY_IMAGE_TAG=stretch make release'
}
}
stage('Debian Stable & Testing') {
agent {
node {
label 'bionic'
}
}
environment {
PACKAGE_TYPE = 'deb'
RESTY_IMAGE_BASE = 'debian'
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'RESTY_IMAGE_TAG=buster make release'
sh 'RESTY_IMAGE_TAG=bullseye make release'
}
}
stage('Ubuntu') {
agent {
node {
label 'bionic'
}
}
environment {
PACKAGE_TYPE = 'deb'
RESTY_IMAGE_BASE = 'ubuntu'
RESTY_IMAGE_TAG = 'bionic'
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
PACKAGE_TYPE = "deb"
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'RESTY_IMAGE_TAG=bionic make release'
sh 'RESTY_IMAGE_TAG=focal make release'
sh 'make RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=9 release'
sh 'make RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=10 release'
sh 'make RESTY_IMAGE_BASE=debian RESTY_IMAGE_TAG=11 release'
sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=16.04 release'
sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=18.04 release'
sh 'make RESTY_IMAGE_BASE=ubuntu RESTY_IMAGE_TAG=20.04 release'
}
}
stage('Ubuntu Xenial') {
stage('SRC & Alpine') {
agent {
node {
label 'bionic'
}
}
environment {
PACKAGE_TYPE = 'deb'
RESTY_IMAGE_BASE = 'ubuntu'
RESTY_IMAGE_TAG = 'xenial'
CACHE = 'false'
UPDATE_CACHE = 'true'
USER = 'travis'
KONG_SOURCE_LOCATION = "${env.WORKSPACE}"
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
GITHUB_SSH_KEY = credentials('github_bot_ssh_key')
PACKAGE_TYPE = "rpm"
AWS_ACCESS_KEY = credentials('AWS_ACCESS_KEY')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'DOCKER_MACHINE_ARM64_NAME="jenkins-kong-"`cat /proc/sys/kernel/random/uuid` make release'
}
post {
cleanup {
dir('../kong-build-tools'){ sh 'make cleanup-build' }
}
sh 'make RESTY_IMAGE_BASE=src RESTY_IMAGE_TAG=src PACKAGE_TYPE=src release'
sh 'make RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3.10 PACKAGE_TYPE=apk DOCKER_MACHINE_ARM64_NAME="kong-"`cat /proc/sys/kernel/random/uuid` release'
}
}
}
}
stage('Post Packaging Steps') {
stage('Post Release Steps') {
when {
beforeAgent true
allOf {
Expand Down
12 changes: 9 additions & 3 deletions kong/clustering/control_plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ local REMOVED_FIELDS = require("kong.clustering.compat.removed_fields")
local _log_prefix = "[clustering] "


local function handle_export_deflated_reconfigure_payload(self)
local ok, p_err, err = pcall(self.export_deflated_reconfigure_payload, self)
return ok, p_err or err
end


local function plugins_list_to_map(plugins_list)
local versions = {}
for _, plugin in ipairs(plugins_list) do
Expand Down Expand Up @@ -481,7 +487,7 @@ function _M:handle_cp_websocket()
self.clients[wb] = queue

if not self.deflated_reconfigure_payload then
_, err = self:export_deflated_reconfigure_payload()
_, err = handle_export_deflated_reconfigure_payload(self)
end

if self.deflated_reconfigure_payload then
Expand Down Expand Up @@ -654,8 +660,8 @@ local function push_config_loop(premature, self, push_config_semaphore, delay)
return
end

local _, err = self:export_deflated_reconfigure_payload()
if err then
local ok, err = handle_export_deflated_reconfigure_payload(self)
if not ok then
ngx_log(ngx_ERR, _log_prefix, "unable to export initial config from database: ", err)
end

Expand Down
15 changes: 11 additions & 4 deletions kong/clustering/wrpc_control_plane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ local _log_prefix = "[wrpc-clustering] "

local wrpc_config_service


local function handle_export_deflated_reconfigure_payload(self)
local ok, p_err, err = pcall(self.export_deflated_reconfigure_payload, self)
return ok, p_err or err
end


local function get_config_service(self)
if not wrpc_config_service then
wrpc_config_service = wrpc.new_service()
Expand Down Expand Up @@ -171,8 +178,8 @@ end

function _M:push_config_one_client(client)
if not self.config_call_rpc or not self.config_call_args then
local payload, err = self:export_deflated_reconfigure_payload()
if not payload then
local ok, err = handle_export_deflated_reconfigure_payload(self)
if not ok then
ngx_log(ngx_ERR, _log_prefix, "unable to export config from database: ", err)
return
end
Expand Down Expand Up @@ -558,8 +565,8 @@ local function push_config_loop(premature, self, push_config_semaphore, delay)
end

do
local _, err = self:export_deflated_reconfigure_payload()
if err then
local ok, err = handle_export_deflated_reconfigure_payload(self)
if not ok then
ngx_log(ngx_ERR, _log_prefix, "unable to export initial config from database: ", err)
end
end
Expand Down
6 changes: 6 additions & 0 deletions kong/cmd/utils/prefix_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,13 @@ local function prepare_prefix(kong_config, nginx_custom_template_path, skip_writ
"",
}

local refs = kong_config["$refs"]

for k, v in pairs(kong_config) do
if refs and refs[k] then
v = refs[k]
end

if type(v) == "table" then
if (getmetatable(v) or {}).__tostring then
-- the 'tostring' meta-method knows how to serialize
Expand Down
3 changes: 2 additions & 1 deletion kong/cmd/vault.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ end


local function get(args)
local vault = require "kong.pdk.vault".new()
if args.command == "get" then
local reference = args[1]
if not reference then
Expand All @@ -51,6 +50,8 @@ local function get(args)

init_db(args)

local vault = kong.vault

if not vault.is_reference(reference) then
-- assuming short form: <name>/<resource>[/<key>]
reference = fmt("{vault://%s}", reference)
Expand Down
Loading

0 comments on commit b9f5b65

Please sign in to comment.