mirror of
https://github.com/alibaba/higress.git
synced 2026-03-02 23:51:11 +08:00
[key-auth] record consumer name once the consumer name is determined (#2978)
This commit is contained in:
@@ -291,6 +291,8 @@ func onHttpRequestHeaders(ctx wrapper.HttpContext, config KeyAuthConfig, log log
|
||||
return deniedUnauthorizedConsumer()
|
||||
}
|
||||
|
||||
proxywasm.AddHttpRequestHeader("X-Mse-Consumer", name)
|
||||
|
||||
// 全局生效:
|
||||
// - global_auth == true 且 当前 domain/route 未配置该插件
|
||||
// - global_auth 未设置 且 没有任何一个 domain/route 配置该插件
|
||||
@@ -343,7 +345,6 @@ func deniedUnauthorizedConsumer() types.Action {
|
||||
}
|
||||
|
||||
func authenticated(name string) types.Action {
|
||||
_ = proxywasm.AddHttpRequestHeader("X-Mse-Consumer", name)
|
||||
return types.ActionContinue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user