From 2d5362073c61154280b7cd3ac082516113e703f2 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Tue, 6 May 2014 22:38:02 +0000 Subject: [PATCH] HADOOP-10471. Reduce the visibility of constants in ProxyUsers. Contributed by Benoy Antony. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1592915 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../org/apache/hadoop/security/authorize/ProxyUsers.java | 6 +++--- .../org/apache/hadoop/hdfs/server/common/TestJspHelper.java | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 7ffd913a8c..3b32f99c0b 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -368,6 +368,9 @@ Release 2.5.0 - UNRELEASED HADOOP-10549. MAX_SUBST and varPat should be final in Configuration.java. (Gera Shegalov via cnauroth) + HADOOP-10471. Reduce the visibility of constants in ProxyUsers. + (Benoy Antony via wheat9) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java index 7da5014e33..f83560c3bd 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ProxyUsers.java @@ -40,9 +40,9 @@ public class ProxyUsers { private static final String CONF_HOSTS = ".hosts"; - public static final String CONF_GROUPS = ".groups"; - public static final String CONF_HADOOP_PROXYUSER = "hadoop.proxyuser."; - public static final String CONF_HADOOP_PROXYUSER_RE = "hadoop\\.proxyuser\\."; + private static final String CONF_GROUPS = ".groups"; + private static final String CONF_HADOOP_PROXYUSER = "hadoop.proxyuser."; + private static final String CONF_HADOOP_PROXYUSER_RE = "hadoop\\.proxyuser\\."; public static final String CONF_HADOOP_PROXYSERVERS = "hadoop.proxyservers"; private static boolean init = false; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java index 1b45e33fe5..f6e63ccaf1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java @@ -284,8 +284,8 @@ public void testGetProxyUgi() throws IOException { String user = "TheNurse"; conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); - conf.set(ProxyUsers.CONF_HADOOP_PROXYUSER+realUser+".groups", "*"); - conf.set(ProxyUsers.CONF_HADOOP_PROXYUSER+realUser+".hosts", "*"); + conf.set(ProxyUsers.getProxySuperuserGroupConfKey(realUser), "*"); + conf.set(ProxyUsers.getProxySuperuserIpConfKey(realUser), "*"); ProxyUsers.refreshSuperUserGroupsConfiguration(conf); UserGroupInformation.setConfiguration(conf); UserGroupInformation ugi;