hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (HIVE-22267) Support password based authentication in HMS
Date Sat, 05 Oct 2019 13:00:07 GMT

     [ https://issues.apache.org/jira/browse/HIVE-22267?focusedWorklogId=323916&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-323916
]

ASF GitHub Bot logged work on HIVE-22267:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Oct/19 13:00
            Start Date: 05/Oct/19 13:00
    Worklog Time Spent: 10m 
      Work Description: ashutosh-bapat commented on pull request #793: HIVE-22267 : Support
password based authentication for HMS along-side kerberos authentication.
URL: https://github.com/apache/hive/pull/793#discussion_r331745892
 
 

 ##########
 File path: standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreCustomAuth.java
 ##########
 @@ -0,0 +1,95 @@
+/*
+ * 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.hadoop.hive.metastore;
+
+import org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf.ConfVars;
+import org.apache.hadoop.security.alias.CredentialProviderFactory;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.experimental.categories.Category;
+
+import javax.security.sasl.AuthenticationException;
+import java.util.HashMap;
+import java.util.Map;
+
+@Category(MetastoreCheckinTest.class)
+public class TestRemoteHiveMetaStoreCustomAuth extends TestRemoteHiveMetaStore {
+  private static String correctUser = "correct_user";
+  private static String correctPassword = "correct_passwd";
+  private static String wrongPassword = "wrong_password";
+  private static String wrongUser = "wrong_user";
+
+  @Before
+  public void setUp() throws Exception {
+    initConf();
+    MetastoreConf.setVar(conf, ConfVars.THRIFT_METASTORE_AUTHENTICATION, "CUSTOM");
+    MetastoreConf.setVar(conf, ConfVars.THRIFT_CUSTOM_AUTHENTICATION_CLASS,
+            "org.apache.hadoop.hive.metastore.TestRemoteHiveMetaStoreCustomAuth$SimpleAuthenticationProviderImpl");
+    MetastoreConf.setBoolVar(conf, ConfVars.EXECUTE_SET_UGI, false);
+    super.setUp();
+  }
+
+  @Override
+  protected HiveMetaStoreClient createClient() throws Exception {
+    boolean gotException = false;
+    MetastoreConf.setVar(conf, ConfVars.THRIFT_URIS, "thrift://localhost:" + port);
+    MetastoreConf.setBoolVar(conf, ConfVars.METASTORE_CLIENT_USE_PLAIN_AUTH, true);
+    String tmpDir = System.getProperty("build.dir");
+    String credentialsPath = "jceks://file" + tmpDir + "/test-classes/creds/hms_plain_auth_test.jceks";
+    conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, credentialsPath);
+
+    try {
+      MetastoreConf.setVar(conf, ConfVars.METASTORE_CLIENT_PLAIN_USERNAME, wrongUser);
+      HiveMetaStoreClient tmpClient = new HiveMetaStoreClient(conf);
+    } catch (Exception e) {
+      gotException = true;
+    }
+    // Trying to log in using wrong username and password should fail
+    Assert.assertTrue(gotException);
 
 Review comment:
   Done.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 323916)
    Time Spent: 3h 50m  (was: 3h 40m)

> Support password based authentication in HMS
> --------------------------------------------
>
>                 Key: HIVE-22267
>                 URL: https://issues.apache.org/jira/browse/HIVE-22267
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Ashutosh Bapat
>            Assignee: Ashutosh Bapat
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22267.00.patch, HIVE-22267.01.patch, HIVE-22267.02.patch, HIVE-22267.03.patch,
HIVE-22267.04.patch, HIVE-22267.05.patch, HIVE-22267.06.patch, HIVE-22267.07.patch, HIVE-22267.08.patch
>
>          Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> Similar to HS2, support password based authentication in HMS.
> Right now we provide LDAP and CONFIG based options. The later allows to set user and
password in config and is used only for testing.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message