Skip to content

Commit efdf4e4

Browse files
author
Crazy-xyr
committed
Revert "fix: plugin.enable_data_encryption initialization issue"
This reverts commit 2ead234.
1 parent 378b66a commit efdf4e4

File tree

3 files changed

+5
-238
lines changed

3 files changed

+5
-238
lines changed

apisix/admin/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ local function run()
235235
end
236236

237237
if code then
238-
if code == 200 and method == "get" and plugin.enable_gde() then
238+
if method == "get" and plugin.enable_data_encryption then
239239
if seg_res == "consumers" or seg_res == "credentials" then
240240
utils.decrypt_params(plugin.decrypt_conf, data, core.schema.TYPE_CONSUMER)
241241
elseif seg_res == "plugin_metadata" then

apisix/plugin.lua

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -935,18 +935,15 @@ end
935935

936936
local enable_data_encryption
937937
local function enable_gde()
938-
if enable_data_encryption ~= nil then
939-
return enable_data_encryption
940-
end
941-
942-
enable_data_encryption =
938+
if enable_data_encryption == nil then
939+
enable_data_encryption =
943940
core.table.try_read_attr(local_conf, "apisix", "data_encryption",
944941
"enable_encrypt_fields") and (core.config.type == "etcd")
945-
_M.enable_data_encryption = enable_data_encryption
942+
_M.enable_data_encryption = enable_data_encryption
943+
end
946944

947945
return enable_data_encryption
948946
end
949-
_M.enable_gde = enable_gde
950947

951948

952949
local function get_plugin_schema_for_gde(name, schema_type)

t/admin/plugin-metadata3.t

Lines changed: 0 additions & 230 deletions
This file was deleted.

0 commit comments

Comments
 (0)