-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
enhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.help wantedNeeds help!Needs help!
Milestone
Description
Hi,
I'm trying to implement simple basic auth using LUA, and I want to activate the filter on selected routes. But it seems that I can't get to make per_filter_config on route configuration work. Am I missing something ?
This is working:
- filters:
- name: envoy.http_connection_manager
config:
access_log:
name: envoy.file_access_log
config:
path: /dev/stdout
codec_type: auto
stat_prefix: ingress_http
route_config:
name: proxy
virtual_hosts:
- name: backend
domains:
- '*'
routes:
- match:
prefix: /api
route:
cluster: api
- match:
prefix: /
route:
cluster: web
http_filters:
- name: envoy.lua
config:
inline_code: |
function envoy_on_request(request_handle)
request_handle:respond(
{
[":status"] = "401",
["Content-Type"] = "text/plain",
["WWW-Authenticate"] = "Basic"
},
"Please authenticate!"
)
end
- name: envoy.router
config: {}But this is not:
- filters:
- name: envoy.http_connection_manager
config:
access_log:
name: envoy.file_access_log
config:
path: /dev/stdout
codec_type: auto
stat_prefix: ingress_http
route_config:
name: proxy
virtual_hosts:
- name: backend
domains:
- '*'
routes:
- match:
prefix: /api
route:
cluster: api
- match:
prefix: /
per_filter_config:
envoy.lua:
inline_code: |
function envoy_on_request(request_handle)
request_handle:respond(
{
[":status"] = "401",
["Content-Type"] = "text/plain",
["WWW-Authenticate"] = "Basic"
},
"Please authenticate!"
)
end
route:
cluster: web
http_filters:
- name: envoy.router
config: {}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.help wantedNeeds help!Needs help!