This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 920a6db  Fix username@cluster:passwod is modified to cluster: 
username:passwod causes authentication failure (#8115)
920a6db is described below

commit 920a6db5a7f1864549ac2a02b5d138a567b9235d
Author: Z6N <[email protected]>
AuthorDate: Fri Feb 18 11:19:17 2022 +0800

    Fix username@cluster:passwod is modified to cluster: username:passwod 
causes authentication failure (#8115)
    
    Fix username@cluster:passwod is modified to cluster: username:passwod 
causes authentication failure
    
    Co-authored-by: z6n <[email protected]>
---
 .../main/java/org/apache/doris/httpv2/rest/RestBaseController.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/RestBaseController.java 
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/RestBaseController.java
index e5988fd..e2763ca 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/RestBaseController.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/RestBaseController.java
@@ -75,7 +75,11 @@ public class RestBaseController extends BaseController {
         String userInfo = null;
         if (!Strings.isNullOrEmpty(request.getHeader("Authorization"))) {
             ActionAuthorizationInfo authInfo = getAuthorizationInfo(request);
-            userInfo = authInfo.fullUserName + ":" + authInfo.password;
+            // 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;
         }
         try {
             urlObj = new URI(urlStr);

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to