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:
Kent Dong
2026-05-15 16:03:50 +08:00
committed by GitHub
parent e497d8017a
commit ba774da55e
8 changed files with 553 additions and 8 deletions

View File

@@ -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