Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
oowl committed Oct 22, 2024
1 parent 22aa630 commit 48e2ce5
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions kong/tls/plugins/sni_filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ local chain_lib = require "resty.openssl.x509.chain"
local _M = {}

local kong = kong
local null = ngx.null
local ipairs = ipairs
local new_tab = require("table.new")

Expand Down Expand Up @@ -234,47 +233,6 @@ function _M.sni_cache_l1_serializer(snis)
return snis
end

local function each_enabled_plugin(entity, plugin_name)
local options = {
show_ws_id = true,
workspace = null,
search_fields = {
name = { eq = plugin_name },
enabled = { eq = true }
}
}

local iter = entity:each(1000, options)
local function iterator()
if not iter then return end
local element, err = iter()
if err then return nil, err end
if element == nil then return end
-- XXX
-- `search_fields` is PostgreSQL-backed instances only.
-- We also need a backstop here for Cassandra or DBless.
if element.name == plugin_name and element.enabled then return element, nil end
return iterator()
end

return iterator
end

local workspaces_iter
do
local pok = pcall(require, "kong.workspaces")
if not pok then
-- no workspace support, that's fine
workspaces_iter = function(_) return next, { default = {} }, nil end

else
workspaces_iter = function(db)
ngx.log(ngx.ERR, "using workspace support")
return db.workspaces:each(1000)
end
end
end

function _M.build_ssl_route_filter_set(plugin_name)
kong.log.debug("building ssl route filter set for plugin name " .. plugin_name)
local db = kong.db
Expand Down

0 comments on commit 48e2ce5

Please sign in to comment.