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 2021/07/29 11:18:57 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #4702: feat: support aliyun mse nacos ram

spacewander commented on a change in pull request #4702:
URL: https://github.com/apache/apisix/pull/4702#discussion_r679059871



##########
File path: apisix/discovery/nacos.lua
##########
@@ -211,7 +272,7 @@ local function get_base_uri()
         url = url .. '/'
     end
 
-    return url, username, password
+    return url, username, password, access_key, secret_key, authorization_type

Review comment:
       What about returning:
   ```
   url, authorization_type, username, password, access_key, secret_key
   or
   url, authorization_type, access_key, secret_key
   ```

##########
File path: apisix/discovery/nacos.lua
##########
@@ -92,14 +105,59 @@ local function discovery_nacos_callback(data, event, source, pid)
                ", application: ", core.json.encode(applications, true))
 end
 
-local function request(request_uri, path, body, method, basic_auth)
+local function get_aliyun_ram_sign_headers(param_values, access_key, secret_key)
+    if not param_values then
+        return {}
+    end
+
+    local namespace_id = param_values['namespace_id']
+    local group_name = param_values['group_name']
+    local time_ngx = ngx.utctime()
+    local time_change = string.gsub(time_ngx, " ", "T")
+    local time_utc = table.concat({time_change, "Z"})

Review comment:
       Why not use `time_change .. "Z"` directly?

##########
File path: docs/en/latest/discovery/nacos.md
##########
@@ -38,6 +38,10 @@ discovery:
   nacos:
     host:
       - "http://${username}:${password}@${host1}:${port1}"
+    authorization:
+      type: "basic_auth"  # default basic_auth
+      access_key: ""      # default empty

Review comment:
       We can omit the key for this auth type.
   BTW, basic_auth makes me think about this: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication. Is there a better name?




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