Skip to content

Commit

Permalink
add log for auth params both in header and params
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-smile committed Nov 1, 2023
1 parent d9ab3e7 commit 3361c01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/apisix/plugins/bk-delete-sensitive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ local function delete_sensitive_params(ctx, sensitive_keys, unfiltered_sensitive
end

if ctx.var.auth_params_location == "header" and (query_changed or form_changed or body_changed) then
core.log.warn(
"auth params exist in both header X-Bkapi-Authorization and request parameters, request_id: " ..
ctx.var.bk_request_id
)
-- 记录认证参数位置,便于统计哪些请求将认证参数放到请求参数,推动优化
ctx.var.auth_params_location = "header_and_params"
end
Expand Down

0 comments on commit 3361c01

Please sign in to comment.