nic-6443 commented on code in PR #12629:
URL: https://github.com/apache/apisix/pull/12629#discussion_r2373933007
##########
apisix/balancer.lua:
##########
@@ -194,7 +195,20 @@ end
-- 2. each time we need to retry upstream
local function pick_server(route, ctx)
core.log.info("route: ", core.json.delay_encode(route, true))
- core.log.info("ctx: ", core.json.delay_encode(ctx, true))
+ local redacted_ctx = core.table.deepcopy(ctx)
+ for name, conf in pairs(ctx.var._ctx.consumer.plugins) do
+ local plugin = require("apisix.plugins."..name)
+ local schema
+ if plugin.type == "auth" then
+ schema = plugin.consumer_schema
+ else
+ schema = plugin.schema
+ end
+ redacted_ctx.var._ctx.consumer.plugins[name] = redact_encrypted(conf,
schema)
+ local redacted_auth =
redact_encrypted(redacted_ctx.var._ctx.consumer.auth_conf, schema)
+ redacted_ctx.var._ctx.consumer.auth_conf = redacted_auth
+ end
Review Comment:
this code snippet repeated multiple times, we should put it into a util
function to reuse it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]