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

This commit is contained in:
Madhan Neethiraj 2018-11-30 15:43:50 -08:00
parent e4921452eb
commit b919d3d096
1 changed files with 3 additions and 2 deletions

View File

@ -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() {