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

Signed-off-by: Aapo Talvensaari <[email protected]>
  • Loading branch information
bungle committed Jun 5, 2023
1 parent 750ba97 commit fd973ec
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit fd973ec

Please sign in to comment.