You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/11/28 11:23:57 UTC

[GitHub] [apisix] tzssangglass commented on a diff in pull request #8403: feat: support global data encryption of secret information

tzssangglass commented on code in PR #8403:
URL: https://github.com/apache/apisix/pull/8403#discussion_r1033423399


##########
apisix/consumer.lua:
##########
@@ -32,6 +33,23 @@ local lrucache = core.lrucache.new({
     ttl = 300, count = 512
 })
 
+
+local function decrypt_items(name, conf)
+    local schema = plugin.get(name)
+    local consumer_schema = schema.consumer_schema
+    if not consumer_schema then
+        return
+    end
+
+    for key, props in pairs(consumer_schema.properties) do
+        if props.type == "string" and props.encrypted then
+            local encrypted = apisix_ssl.aes_decrypt_pkey(conf[key], "global_data_encrypt")
+            conf[key] = encrypted
+        end
+    end

Review Comment:
   I know that since this PR does not include this case, we can optimize this point in the next PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org