You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2020/05/14 06:15:51 UTC
[hbase] branch branch-2 updated: Revert "Make kerberos value of
hbase.security.authentication property case insensitive (#1687)"
This is an automated email from the ASF dual-hosted git repository.
vjasani pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new b78f436 Revert "Make kerberos value of hbase.security.authentication property case insensitive (#1687)"
b78f436 is described below
commit b78f4367f710a8cb2b3df37ba158604e530301dc
Author: Viraj Jasani <vj...@apache.org>
AuthorDate: Thu May 14 11:45:23 2020 +0530
Revert "Make kerberos value of hbase.security.authentication property case insensitive (#1687)"
This reverts commit c03ec837e70ebf014aabd8610d5fe4d53b239efa.
---
.../org/apache/hadoop/hbase/TestHBaseConfiguration.java | 15 ---------------
.../java/org/apache/hadoop/hbase/http/InfoServer.java | 2 +-
.../java/org/apache/hadoop/hbase/mapreduce/SyncTable.java | 4 ++--
3 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java
index 6a0b428..184cdf6 100644
--- a/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java
+++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java
@@ -27,11 +27,9 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.hbase.testclassification.MiscTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.junit.AfterClass;
-import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -103,19 +101,6 @@ public class TestHBaseConfiguration {
}
}
- @Test
- public void testSecurityConfCaseInsensitive() {
- Configuration conf = HBaseConfiguration.create();
- conf.set("hbase.security.authentication", "kerberos");
- Assert.assertTrue(User.isHBaseSecurityEnabled(conf));
-
- conf.set("hbase.security.authentication", "KERBEROS");
- Assert.assertTrue(User.isHBaseSecurityEnabled(conf));
-
- conf.set("hbase.security.authentication", "KERBeros");
- Assert.assertTrue(User.isHBaseSecurityEnabled(conf));
- }
-
private static class ReflectiveCredentialProviderClient {
public static final String HADOOP_CRED_PROVIDER_FACTORY_CLASS_NAME =
"org.apache.hadoop.security.alias.JavaKeyStoreProvider$Factory";
diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java
index 6a1ffbc..6ee37cb 100644
--- a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java
+++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java
@@ -173,7 +173,7 @@ public class InfoServer {
return false;
}
String remoteUser = req.getRemoteUser();
- if ("kerberos".equalsIgnoreCase(conf.get(HttpServer.HTTP_UI_AUTHENTICATION)) &&
+ if ("kerberos".equals(conf.get(HttpServer.HTTP_UI_AUTHENTICATION)) &&
conf.getBoolean(CommonConfigurationKeys.HADOOP_SECURITY_AUTHORIZATION, false) &&
remoteUser != null) {
return HttpServer.userHasAdministratorAccess(ctx, remoteUser);
diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java
index cf9241d..e092f90 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java
@@ -91,7 +91,7 @@ public class SyncTable extends Configured implements Tool {
private void initCredentialsForHBase(String zookeeper, Job job) throws IOException {
Configuration peerConf = HBaseConfiguration.createClusterConf(job
.getConfiguration(), zookeeper);
- if("kerberos".equalsIgnoreCase(peerConf.get("hbase.security.authentication"))){
+ if(peerConf.get("hbase.security.authentication").equals("kerberos")){
TableMapReduceUtil.initCredentialsForCluster(job, peerConf);
}
}
@@ -105,7 +105,7 @@ public class SyncTable extends Configured implements Tool {
Job job = Job.getInstance(getConf(),getConf().get("mapreduce.job.name",
"syncTable_" + sourceTableName + "-" + targetTableName));
Configuration jobConf = job.getConfiguration();
- if ("kerberos".equalsIgnoreCase(jobConf.get("hadoop.security.authentication"))) {
+ if (jobConf.get("hadoop.security.authentication").equals("kerberos")) {
TokenCache.obtainTokensForNamenodes(job.getCredentials(), new
Path[] { sourceHashDir }, getConf());
}