Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter state: Add missing api to get filterstate format working (envo…
…yproxy#35559) Commit Message: Filter state: Add missing api to get filterstate format working Additional Description: Consider the case where filter state is being set using the `set_filter_state` filter: ``` - name: "envoy.filters.http.set_filter_state" typed_config: "@type": "type.googleapis.com/envoy.extensions.filters.http.set_filter_state.v3.Config" on_request_headers: - object_key: "envoy.network.upstream_server_name" format_string: text_format_source: inline_string: "%REQ(:AUTHORITY)%" shared_with_upstream: "TRANSITIVE" ``` Now if one try to use the value from the filter state, for example in the tunneling config hostname: ``` - name: encap internal_listener: {} filter_chains: - filters: - name: tcp typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy stat_prefix: tcp_stats cluster: cluster_0 tunneling_config: hostname: "%FILTER_STATE(envoy.network.upstream_server_name:PLAIN)%" ``` Then filter state formatter fails to find the value because [here](https://github.com/envoyproxy/envoy/blob/main/source/common/formatter/stream_info_formatter.cc#L239), it invokes `serializeAsString()` on the stored filter state object, which is `UpstreamServerName` instance in this case and it is missing this function. I think similar change would be required for other well-known name objects as well like Upstream subject alt names and alpn application protocols. related envoyproxy#30674 --------- Signed-off-by: Vikas Choudhary <[email protected]> Signed-off-by: Vikas Choudhary (vikasc) <[email protected]>
- Loading branch information