You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by el...@apache.org on 2012/04/24 06:00:11 UTC
svn commit: r1329542 - in
/hadoop/common/branches/branch-2/hadoop-common-project: ./ hadoop-auth/
hadoop-common/ hadoop-common/src/main/docs/ hadoop-common/src/main/java/
hadoop-common/src/main/java/org/apache/hadoop/security/
hadoop-common/src/test/core/
Author: eli
Date: Tue Apr 24 04:00:10 2012
New Revision: 1329542
URL: http://svn.apache.org/viewvc?rev=1329542&view=rev
Log:
HADOOP-8152. svn merge -c 1329541 from trunk
Modified:
hadoop/common/branches/branch-2/hadoop-common-project/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (contents, props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/docs/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/ (props changed)
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/core/ (props changed)
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project:r1329541
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-auth:r1329541
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common:r1329541
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1329542&r1=1329541&r2=1329542&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Tue Apr 24 04:00:10 2012
@@ -144,6 +144,8 @@ Release 2.0.0 - UNRELEASED
HADOOP-8117. Upgrade test build to Surefire 2.12 (todd)
+ HADOOP-8152. Expand public APIs for security library classes. (atm via eli)
+
OPTIMIZATIONS
BUG FIXES
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt:r1329541
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/docs/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/docs:r1329541
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java:r1329541
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java?rev=1329542&r1=1329541&r2=1329542&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java Tue Apr 24 04:00:10 2012
@@ -220,6 +220,8 @@ public class SecurityUtil {
* @return converted Kerberos principal name
* @throws IOException if the client address cannot be determined
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static String getServerPrincipal(String principalConfig,
String hostname) throws IOException {
String[] components = getComponents(principalConfig);
@@ -245,6 +247,8 @@ public class SecurityUtil {
* @return converted Kerberos principal name
* @throws IOException if the client address cannot be determined
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static String getServerPrincipal(String principalConfig,
InetAddress addr) throws IOException {
String[] components = getComponents(principalConfig);
@@ -292,6 +296,8 @@ public class SecurityUtil {
* the key to look for user's Kerberos principal name in conf
* @throws IOException if login fails
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static void login(final Configuration conf,
final String keytabFileKey, final String userNameKey) throws IOException {
login(conf, keytabFileKey, userNameKey, getLocalHostName());
@@ -312,6 +318,8 @@ public class SecurityUtil {
* hostname to use for substitution
* @throws IOException if the config doesn't specify a keytab
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static void login(final Configuration conf,
final String keytabFileKey, final String userNameKey, String hostname)
throws IOException {
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java?rev=1329542&r1=1329541&r2=1329542&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java Tue Apr 24 04:00:10 2012
@@ -69,7 +69,7 @@ import org.apache.hadoop.util.Shell;
* user's username and groups. It supports both the Windows, Unix and Kerberos
* login modules.
*/
-@InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"})
+@InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce", "HBase", "Hive", "Oozie"})
@InterfaceStability.Evolving
public class UserGroupInformation {
private static final Log LOG = LogFactory.getLog(UserGroupInformation.class);
@@ -258,6 +258,8 @@ public class UserGroupInformation {
* group look up service.
* @param conf the configuration to use
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static void setConfiguration(Configuration conf) {
initialize(conf, false);
}
@@ -500,6 +502,8 @@ public class UserGroupInformation {
* @return the current user
* @throws IOException if login fails
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public synchronized
static UserGroupInformation getCurrentUser() throws IOException {
AccessControlContext context = AccessController.getContext();
@@ -516,6 +520,8 @@ public class UserGroupInformation {
* @return the logged in user
* @throws IOException if login fails
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public synchronized
static UserGroupInformation getLoginUser() throws IOException {
if (loginUser == null) {
@@ -652,6 +658,8 @@ public class UserGroupInformation {
* @param path the path to the keytab file
* @throws IOException if the keytab file can't be read
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public synchronized
static void loginUserFromKeytab(String user,
String path
@@ -710,6 +718,8 @@ public class UserGroupInformation {
* the new credentials.
* @throws IOException on a failure
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public synchronized void reloginFromKeytab()
throws IOException {
if (!isSecurityEnabled() ||
@@ -769,6 +779,8 @@ public class UserGroupInformation {
* the new credentials.
* @throws IOException on a failure
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public synchronized void reloginFromTicketCache()
throws IOException {
if (!isSecurityEnabled() ||
@@ -867,6 +879,8 @@ public class UserGroupInformation {
* Did the login happen via keytab
* @return true or false
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public synchronized static boolean isLoginKeytabBased() throws IOException {
return getLoginUser().isKeytab;
}
@@ -877,6 +891,8 @@ public class UserGroupInformation {
* @param user the full user principal name, must not be empty or null
* @return the UserGroupInformation for the remote user.
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static UserGroupInformation createRemoteUser(String user) {
if (user == null || "".equals(user)) {
throw new IllegalArgumentException("Null user");
@@ -891,6 +907,7 @@ public class UserGroupInformation {
/**
* existing types of authentications' methods
*/
+ @InterfaceAudience.Public
@InterfaceStability.Evolving
public static enum AuthenticationMethod {
SIMPLE,
@@ -908,6 +925,8 @@ public class UserGroupInformation {
* @param realUser
* @return proxyUser ugi
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static UserGroupInformation createProxyUser(String user,
UserGroupInformation realUser) {
if (user == null || "".equals(user)) {
@@ -929,6 +948,8 @@ public class UserGroupInformation {
* get RealUser (vs. EffectiveUser)
* @return realUser running over proxy user
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public UserGroupInformation getRealUser() {
for (RealUser p: subject.getPrincipals(RealUser.class)) {
return p.getRealUser();
@@ -974,7 +995,8 @@ public class UserGroupInformation {
* @param userGroups the names of the groups that the user belongs to
* @return a fake user for running unit tests
*/
- @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"})
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public static UserGroupInformation createUserForTesting(String user,
String[] userGroups) {
ensureInitialized();
@@ -1000,7 +1022,6 @@ public class UserGroupInformation {
* the names of the groups that the user belongs to
* @return a fake user for running unit tests
*/
- @InterfaceAudience.LimitedPrivate( { "HDFS", "MapReduce" })
public static UserGroupInformation createProxyUserForTesting(String user,
UserGroupInformation realUser, String[] userGroups) {
ensureInitialized();
@@ -1029,6 +1050,8 @@ public class UserGroupInformation {
* Get the user's full principal name.
* @return the user's full principal name.
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public String getUserName() {
return user.getName();
}
@@ -1182,6 +1205,8 @@ public class UserGroupInformation {
* @param action the method to execute
* @return the value from the run method
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public <T> T doAs(PrivilegedAction<T> action) {
logPrivilegedAction(subject, action);
return Subject.doAs(subject, action);
@@ -1198,6 +1223,8 @@ public class UserGroupInformation {
* @throws InterruptedException if the action throws an InterruptedException
* @throws UndeclaredThrowableException if the action throws something else
*/
+ @InterfaceAudience.Public
+ @InterfaceStability.Evolving
public <T> T doAs(PrivilegedExceptionAction<T> action
) throws IOException, InterruptedException {
try {
Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/core/
------------------------------------------------------------------------------
Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/core:r1329541