mirror of
https://github.com/alibaba/higress.git
synced 2026-05-27 06:07:27 +08:00
feat(ext-auth): add support for allowed properties forwarding in external authorization requests (#3694)
Signed-off-by: CH3CHO <ch3cho@qq.com>
This commit is contained in:
@@ -152,6 +152,15 @@ func buildExtAuthRequestHeaders(ctx wrapper.HttpContext, cfg config.ExtAuthConfi
|
||||
extAuthReqHeaders.Set(HeaderAuthorization, authorization)
|
||||
}
|
||||
|
||||
// Add filter properties forwarding
|
||||
if requestConfig.AllowedProperties != nil {
|
||||
for _, prop := range requestConfig.AllowedProperties {
|
||||
if raw, err := proxywasm.GetProperty(prop.Path); err == nil {
|
||||
extAuthReqHeaders.Set(prop.Header, string(raw))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add additional headers when endpoint_mode is forward_auth
|
||||
if httpServiceConfig.EndpointMode == config.EndpointModeForwardAuth {
|
||||
// Compatible with older versions
|
||||
|
||||
Reference in New Issue
Block a user