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 2020/11/15 11:47:55 UTC

[GitHub] [apisix] membphis commented on a change in pull request #2690: fix(init_etcd): add Authorization header while enable etcd auth

membphis commented on a change in pull request #2690:
URL: https://github.com/apache/apisix/pull/2690#discussion_r523747590



##########
File path: bin/apisix
##########
@@ -560,6 +560,23 @@ local function init_etcd(show_output)
     for index, host in ipairs(yaml_conf.etcd.host) do
         local is_success = true
 
+        local token_head = ""
+        if etcd_conf.user and etcd_conf.password then
+            local uri_auth = host .. "/v3/auth/authenticate"
+            local post_json_auth = '{"name": "' .. etcd_conf.user .. '", "password": "' .. etcd_conf.password .. '"}'

Review comment:
       yes, `dkjson` is more safe.




----------------------------------------------------------------
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.

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