You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/04 13:37:25 UTC

[GitHub] [incubator-doris] morningman commented on a diff in pull request #9363: [fix]Stream load 307 temporary redirection authentication information is lost

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-unsubscribe@doris.apache.org

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


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