New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selecting a list of WASM filters that a request will run through based on domain/host #33791
Comments
I also found #16651 which seems to indicate that it isn't supported yet. I also found proxy-wasm/proxy-wasm-cpp-host#188. |
A large list of issues which might be related: #16651 (comment) |
The error message you get when you try to use it per filter is:
|
cc @mpwarres |
Does this make sense? https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_filters#route-based-filter-chain By that way, you can disable all wasm filters by default in the HCM and them enable specific some wasm filters on specific virtual host. Considering that the wasm filter has no per route level config, you can use a hack way to enable the filter.
|
@wbpcode this does make sense. I managed to get all my filters loaded in with {
"http_filters": [
{
"name": "envoy.filters.http.wasm",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm",
"config": {
"name": "wasm1",
"vm_config": {
"vm_id": "default",
"runtime": "envoy.wasm.runtime.v8",
"code": {
"local": {
"filename": "/app/wasm/wasm1.wasm"
}
}
},
"configuration": {
"@type": "type.googleapis.com/google.protobuf.StringValue",
"value": "{}"
}
}
},
"disabled": true
},
{
"name": "envoy.filters.http.wasm",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm",
"config": {
"name": "wasm2",
"vm_config": {
"vm_id": "default",
"runtime": "envoy.wasm.runtime.v8",
"code": {
"local": {
"filename": "/app/wasm/wasm2.wasm"
}
}
},
"configuration": {
"@type": "type.googleapis.com/google.protobuf.StringValue",
"value": "{}"
}
}
},
"disabled": true
}
]
} But I can't figure out how to enable them. I've added a |
For completeness my {
"typed_per_filter_config": {
"wasm1": {
"@type": "type.googleapis.com/envoy.config.route.v3.FilterConfig",
"config": {
"@type": "type.googleapis.com/google.protobuf.Empty"
},
"is_optional": true
},
"wasm2": {
"@type": "type.googleapis.com/envoy.config.route.v3.FilterConfig",
"config": {
"@type": "type.googleapis.com/google.protobuf.Empty"
},
"is_optional": true
}
}
} |
I see warnings like this in the logs:
|
cc @marc-barry the used keys in the
|
@wbpcode thanks for clarifying. It works. I apologize for the misunderstanding of how keys work in the |
Title: Question about how to select a list of WASM filters that a request will run through based on domain/host.
Description:
I have a need to proxy plaintext HTTP and dynamically select the list of WASM filters a request will go through based on the domain/host. The HTTP connection manager (https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto.html#http-connection-manager-proto) only supports a single list of filters. I do have virtual hosts (https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto) which match based on domain and cannot use the
typed_per_filter_config
as this isn't supported for WASM filters as per #26440.To better explain what I'd like to do is the following:
www.example.com
example.com
github.com
api.github.com
I attempted to use a composite filter https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/composite_filter but it is designed to match based on the matching API and select a single filter. The list of domains and configurations above is simplified as I'm dealing with 100's to 1000's of domains and have many WASM filters. I am aware that I can match based on the
:authority
header but I can't direct that to a filter list.I'm reaching out to the community to see if there is a way to accomplish what I'm trying to do with WASM filters in the absence of not being able to support it on the per route basis like other filters can.
Relevant Links:
The text was updated successfully, but these errors were encountered: