-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Issue Template
Title: Mechanism for accessing filter-generated data in added user-defined headers
Description:
Envoy currently provides a mechanism for creating user defined headers in the router filter (https://www.envoyproxy.io/docs/envoy/latest/configuration/http_conn_man/headers#config-http-conn-man-headers-custom-request-headers ). However, the only data that can be included in those headers is information about the local/remote address for upstream connection, or data from the upstream configuration (%UPSTREAM_METADATA%). It would be useful to provide a mechanism such that information generated by filters in the chain could be used for creation of user defined headers.
The simplest such mechanism would be to provide access to the dynamicMetadata() (https://github.com/envoyproxy/envoy/blob/master/include/envoy/request_info/request_info.h#L252
) associated with a request by some mechanism parallel to %UPSTREAM_METADATA%. However, that could result in somewhat arbitrary hidden dependencies--e.g. the filter not being in the chain and hence the name being empty. It would be better if this could be integrated with a dependency mechanism (such as that described in #3286 for filter dependencies) such that any use of one filter's output data by user generated headers has to be authorized in the filter chain configuration.
An additional requirement (or possibly "nice-to-have") is that such a dependency mechanism is visible to the producing filter so that if data is not required, the effort required to compute that data may be avoided.