mirror of
https://github.com/alibaba/higress.git
synced 2026-05-28 22:57:31 +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()
|
return deniedUnauthorizedConsumer()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proxywasm.AddHttpRequestHeader("X-Mse-Consumer", name)
|
||||||
|
|
||||||
// 全局生效:
|
// 全局生效:
|
||||||
// - global_auth == true 且 当前 domain/route 未配置该插件
|
// - global_auth == true 且 当前 domain/route 未配置该插件
|
||||||
// - global_auth 未设置 且 没有任何一个 domain/route 配置该插件
|
// - global_auth 未设置 且 没有任何一个 domain/route 配置该插件
|
||||||
@@ -343,7 +345,6 @@ func deniedUnauthorizedConsumer() types.Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func authenticated(name string) types.Action {
|
func authenticated(name string) types.Action {
|
||||||
_ = proxywasm.AddHttpRequestHeader("X-Mse-Consumer", name)
|
|
||||||
return types.ActionContinue
|
return types.ActionContinue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user