You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2016/04/09 04:16:25 UTC
hive git commit: Revert "HIVE-13401: Kerberized HS2 with LDAP auth
enabled fails kerberos/delegation token authentication (Chaoyu Tang,
reviewed by Szehon Ho)"
Repository: hive
Updated Branches:
refs/heads/branch-2.0 c66c7cb28 -> 418ac3169
Revert "HIVE-13401: Kerberized HS2 with LDAP auth enabled fails kerberos/delegation token authentication (Chaoyu Tang, reviewed by Szehon Ho)"
This reverts commit 9ca30cf14044e0442434a9d664af196e02da59ad.
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/418ac316
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/418ac316
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/418ac316
Branch: refs/heads/branch-2.0
Commit: 418ac3169aee3e8a086db2ab687495c0560c7523
Parents: c66c7cb
Author: Sergey Shelukhin <se...@apache.org>
Authored: Fri Apr 8 19:12:53 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Fri Apr 8 19:12:53 2016 -0700
----------------------------------------------------------------------
.../minikdc/TestJdbcNonKrbSASLWithMiniKdc.java | 103 -------------------
1 file changed, 103 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/418ac316/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java
----------------------------------------------------------------------
diff --git a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java
deleted file mode 100644
index 1c1beda..0000000
--- a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcNonKrbSASLWithMiniKdc.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hive.minikdc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.sql.DriverManager;
-import java.sql.SQLException;
-
-import javax.security.sasl.AuthenticationException;
-
-import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
-import org.apache.hive.jdbc.miniHS2.MiniHS2;
-import org.apache.hive.service.auth.PasswdAuthenticationProvider;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class TestJdbcNonKrbSASLWithMiniKdc extends TestJdbcWithMiniKdc{
-
- public static class CustomAuthenticator implements PasswdAuthenticationProvider {
- @Override
- public void Authenticate(String user, String password) throws AuthenticationException {
- if (!("nonkrbuser".equals(user) && "mypwd".equals(password))) {
- throw new AuthenticationException("Authentication failed");
- }
- }
- }
-
- @BeforeClass
- public static void beforeTest() throws Exception {
- Class.forName(MiniHS2.getJdbcDriverName());
- confOverlay.put(ConfVars.HIVE_SERVER2_SESSION_HOOK.varname,
- SessionHookTest.class.getName());
- confOverlay.put(ConfVars.HIVE_SERVER2_CUSTOM_AUTHENTICATION_CLASS.varname,
- CustomAuthenticator.class.getName());
- HiveConf hiveConf = new HiveConf();
- miniHiveKdc = MiniHiveKdc.getMiniHiveKdc(hiveConf);
- miniHS2 = MiniHiveKdc.getMiniHS2WithKerbWithRemoteHMS(miniHiveKdc, hiveConf, "CUSTOM");
- miniHS2.start(confOverlay);
- }
-
- /***
- * Test a nonkrb user could login the kerberized HS2 with authentication type SASL NONE
- * @throws Exception
- */
- @Test
- public void testNonKrbSASLAuth() throws Exception {
- hs2Conn = DriverManager.getConnection(miniHS2.getBaseJdbcURL() + "default;user=nonkrbuser;password=mypwd");
- verifyProperty(SESSION_USER_NAME, "nonkrbuser");
- hs2Conn.close();
- }
-
- /***
- * Negative test, verify that connection to secure HS2 fails if it is noSasl
- * @throws Exception
- */
- @Test
- public void testNoSaslConnectionNeg() throws Exception {
- try {
- String url = miniHS2.getBaseJdbcURL() + "default;auth=noSasl";
- hs2Conn = DriverManager.getConnection(url);
- fail("noSasl connection should fail");
- } catch (SQLException e) {
- // expected error
- assertEquals("08S01", e.getSQLState().trim());
- }
- }
-
- /***
- * Negative test, verify that NonKrb connection to secure HS2 fails if it is
- * user/pwd do not match.
- * @throws Exception
- */
- @Test
- public void testNoKrbConnectionNeg() throws Exception {
- try {
- String url = miniHS2.getBaseJdbcURL() + "default;user=wronguser;pwd=mypwd";
- hs2Conn = DriverManager.getConnection(url);
- fail("noSasl connection should fail");
- } catch (SQLException e) {
- // expected error
- assertEquals("08S01", e.getSQLState().trim());
- }
- }
-}
\ No newline at end of file