From 48e2ce5d2b1015790287584838e76892a81c4d3c Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Tue, 22 Oct 2024 18:18:29 +0800 Subject: [PATCH] fix code --- kong/tls/plugins/sni_filter.lua | 42 --------------------------------- 1 file changed, 42 deletions(-) diff --git a/kong/tls/plugins/sni_filter.lua b/kong/tls/plugins/sni_filter.lua index c5c5fe13acb3..bf1e342ba825 100644 --- a/kong/tls/plugins/sni_filter.lua +++ b/kong/tls/plugins/sni_filter.lua @@ -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") @@ -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