You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2018/12/03 14:53:30 UTC

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

Repository: atlas
Updated Branches:
  refs/heads/master e4921452e -> b919d3d09


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


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

Branch: refs/heads/master
Commit: b919d3d0964efbe1eda40724545d5fa506100a02
Parents: e492145
Author: Madhan Neethiraj <ma...@apache.org>
Authored: Fri Nov 30 15:43:50 2018 -0800
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Fri Nov 30 15:43:50 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/b919d3d0/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() {