From 4f60187714413254208fda538cf1e8c6166ebb8b Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Thu, 24 Apr 2014 21:18:27 +0000 Subject: [PATCH] HADOOP-10539. Provide backward compatibility for ProxyUsers.authorize() call. Contributed by Benoy Antony. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1589884 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../hadoop/security/authorize/ProxyUsers.java | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 2e3caa1274..2e503f8c70 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -410,6 +410,9 @@ Release 2.5.0 - UNRELEASED HADOOP-10531. hadoop-config.sh - bug in --hosts argument. (Sebastien Barrier via wang) + HADOOP-10539. Provide backward compatibility for ProxyUsers.authorize() + call. (Benoy Antony via cnauroth) + Release 2.4.1 - UNRELEASED INCOMPATIBLE CHANGES 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 e919d4e81f..7da5014e33 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 @@ -36,7 +36,7 @@ import com.google.common.annotations.VisibleForTesting; -@InterfaceAudience.Private +@InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce", "HBase", "Hive"}) public class ProxyUsers { private static final String CONF_HOSTS = ".hosts"; @@ -193,6 +193,20 @@ public static synchronized void authorize(UserGroupInformation user, + superUser.getUserName() + " from IP " + remoteAddress); } } + + /** + * This function is kept to provide backward compatibility. + * @param user + * @param remoteAddress + * @param conf + * @throws AuthorizationException + * @deprecated use {@link #authorize(UserGroupInformation, String) instead. + */ + @Deprecated + public static synchronized void authorize(UserGroupInformation user, + String remoteAddress, Configuration conf) throws AuthorizationException { + authorize(user,remoteAddress); + } /** * Return true if the configuration specifies the special configuration value