mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 09:19:39 +02:00
envoy: refactor controlplane xds to new envoyconfig package (#2086)
This commit is contained in:
parent
0e66619081
commit
1dcccf2b56
23 changed files with 421 additions and 378 deletions
25
config/envoyconfig/luascripts/remove-impersonate-headers.lua
Normal file
25
config/envoyconfig/luascripts/remove-impersonate-headers.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
local function starts_with(str, start)
|
||||
return str:sub(1, #start) == start
|
||||
end
|
||||
|
||||
function envoy_on_request(request_handle)
|
||||
local headers = request_handle:headers()
|
||||
local metadata = request_handle:metadata()
|
||||
|
||||
local remove_impersonate_headers = metadata:get("remove_impersonate_headers")
|
||||
if remove_impersonate_headers then
|
||||
local to_remove = {}
|
||||
for k, v in pairs(headers) do
|
||||
if starts_with(k, "impersonate-extra-") or k == "impersonate-group" or k == "impersonate-user" then
|
||||
table.insert(to_remove, k)
|
||||
end
|
||||
end
|
||||
|
||||
for k, v in pairs(to_remove) do
|
||||
headers:remove(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function envoy_on_response(response_handle)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue