Skip to content

Commit

Permalink
feat(response-ratelimiting): add support for secret rotation with red…
Browse files Browse the repository at this point in the history
…is connection (#10570)

Signed-off-by: Aapo Talvensaari <[email protected]>
  • Loading branch information
bungle authored Sep 21, 2023
1 parent 5d8061e commit 83721e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG/unreleased/kong/10570.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
message: "**response-ratelimiting**: add support for secret rotation with redis connection "
type: feature
scope: Plugin
prs:
- 10570

8 changes: 6 additions & 2 deletions kong/plugins/response-ratelimiting/policies/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ local function get_redis_connection(conf)
if is_present(conf.redis_password) then
local ok, err
if is_present(conf.redis_username) then
ok, err = red:auth(conf.redis_username, conf.redis_password)
ok, err = kong.vault.try(function(cfg)
return red:auth(cfg.redis_username, cfg.redis_password)
end, conf)
else
ok, err = red:auth(conf.redis_password)
ok, err = kong.vault.try(function(cfg)
return red:auth(cfg.redis_password)
end, conf)
end
if not ok then
kong.log.err("failed to auth Redis: ", err)
Expand Down

1 comment on commit 83721e6

@khcp-gha-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:83721e6a6e99269682c8c703eefd641e9a84ee49
Artifacts available https://github.com/Kong/kong/actions/runs/6258164050

Please sign in to comment.