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/03/05 01:08:59 UTC

[GitHub] [incubator-apisix] iGeeky commented on a change in pull request #1204: Wolf-Rbac: Add new api `change_pwd` and `user_info`.

iGeeky commented on a change in pull request #1204: Wolf-Rbac: Add new api `change_pwd` and `user_info`.
URL: https://github.com/apache/incubator-apisix/pull/1204#discussion_r388026003
 
 

 ##########
 File path: lua/apisix/plugins/wolf-rbac.lua
 ##########
 @@ -77,6 +81,18 @@ local function create_rbac_token(appid, wolf_token)
     return token_version .. "#" .. appid .. "#" .. wolf_token
 end
 
+local function fail_response(message, init_values)
+    local response = init_values or {}
+    response.message = message
+    return response
+end
+
+local function success_response(message, init_values)
+    local response = init_values or {}
+    response.message = message
 
 Review comment:
   I see that the field in `jwt-auch` is called "message". But the core module uses "error_msg". I chose to be consistent with `jwt-auch`
   
   In the aspect of returning error information, I think the core module should provide a unified function to handle it. In this way, the structure of error/correct information returned by the whole system can be consistent. This is still important for API services. Otherwise, the client may have to handle several different information structures

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


With regards,
Apache Git Services