Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 b2ab792d4 -> 5cad8c4b0


ATLAS-2986: updated AtlasClient to skip doAs query parameter when username is 
same as the logged in user

(cherry picked from commit b919d3d0964efbe1eda40724545d5fa506100a02)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/5cad8c4b
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/5cad8c4b
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/5cad8c4b

Branch: refs/heads/branch-0.8
Commit: 5cad8c4b0601812b4ed9581eaa1db42042a2e35f
Parents: b2ab792
Author: Madhan Neethiraj <mad...@apache.org>
Authored: Fri Nov 30 15:43:50 2018 -0800
Committer: Madhan Neethiraj <mad...@apache.org>
Committed: Mon Dec 3 06:54:26 2018 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/atlas/security/SecureClientUtils.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/5cad8c4b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
----------------------------------------------------------------------
diff --git 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
index 550ef5a..aeae300 100644
--- 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
+++ 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
@@ -80,9 +80,10 @@ public class SecureClientUtils {
                     (ugiToUse.getAuthenticationMethod() == 
UserGroupInformation.AuthenticationMethod.PROXY)
                     ? ugiToUse.getRealUser() : ugiToUse;
             LOG.info("Real User: {}, is from ticket cache? {}", actualUgi, 
actualUgi.isLoginTicketBased());
-            if (StringUtils.isEmpty(doAsUser)) {
-                doAsUser = actualUgi.getShortUserName();
+            if (StringUtils.isEmpty(doAsUser) || StringUtils.equals(doAsUser, 
actualUgi.getShortUserName())) {
+                doAsUser = null;
             }
+
             LOG.info("doAsUser: {}", doAsUser);
             final String finalDoAsUser = doAsUser;
             httpURLConnectionFactory = new HttpURLConnectionFactory() {

Reply via email to