morningman commented on code in PR #9363:
URL: https://github.com/apache/incubator-doris/pull/9363#discussion_r864836209


##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/RestBaseController.java:
##########
@@ -77,9 +77,10 @@ public RedirectView redirectTo(HttpServletRequest request, 
TNetworkAddress addr)
             ActionAuthorizationInfo authInfo = getAuthorizationInfo(request);
             // Fix username@cluster:passwod is modified to cluster: 
username:passwod causes authentication failure
             // @see https://github.com/apache/incubator-doris/issues/8100
-            userInfo = 
ClusterNamespace.getNameFromFullName(authInfo.fullUserName) +
-                    "@" + 
ClusterNamespace.getClusterNameFromFullName(authInfo.fullUserName) +
-                    ":" + authInfo.password;
+            String clusterName = ConnectContext.get().getClusterName();

Review Comment:
   Change the comment to:
   ```
   The final redirect userInfo format is like:
   username@cluster:password
   This format will be parsed at BaseController#parseAuthInfo
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/RestBaseController.java:
##########
@@ -77,9 +77,10 @@ public RedirectView redirectTo(HttpServletRequest request, 
TNetworkAddress addr)
             ActionAuthorizationInfo authInfo = getAuthorizationInfo(request);
             // Fix username@cluster:passwod is modified to cluster: 
username:passwod causes authentication failure
             // @see https://github.com/apache/incubator-doris/issues/8100
-            userInfo = 
ClusterNamespace.getNameFromFullName(authInfo.fullUserName) +
-                    "@" + 
ClusterNamespace.getClusterNameFromFullName(authInfo.fullUserName) +
-                    ":" + authInfo.password;
+            String clusterName = ConnectContext.get().getClusterName();

Review Comment:
   ```suggestion
               String clusterName = ConnectContext.get() == null ? 
SystemInfoService.DEFAULT_CLUSTER : ConnectContext.get().getClusterName();
   ```



-- 
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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to