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

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

                Author: ASF GitHub Bot
            Created on: 28/May/19 22:40
            Start Date: 28/May/19 22:40
    Worklog Time Spent: 10m 
      Work Description: daijyc commented on pull request #650: HIVE-21753: 
Update HiveMetastore authorization to enable use of HiveA…
URL: https://github.com/apache/hive/pull/650#discussion_r288330067
 
 

 ##########
 File path: 
ql/src/test/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/DummyHiveAuthorizerFactory.java
 ##########
 @@ -0,0 +1,41 @@
+/*
+ * 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.ql.security.authorization.plugin.metastore;
+
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider;
+import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthorizer;
+import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthorizerFactory;
+import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzPluginException;
+import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzSessionContext;
+import 
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveMetastoreClientFactory;
+import org.mockito.Mockito;
+
+/*
+Dummy HiveAuthorizerFactory
+*/
+
+public class DummyHiveAuthorizerFactory implements HiveAuthorizerFactory {
+  @Override
+  public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory 
metastoreClientFactory,
+                                               HiveConf conf, 
HiveAuthenticationProvider hiveAuthenticator, HiveAuthzSessionContext ctx)
+    throws HiveAuthzPluginException {
+    return Mockito.mock(HiveAuthorizer.class);
 
 Review comment:
   Wonder if we write a HiveAuthorizer which wraps the logic currently in 
DummyDenyAccessHiveMetaStoreAuthorizer/AllowAccessHiveMetaStoreAuthorizer? Thus 
we can test HiveMetaStoreAuthorizer itself. I think you can derive from 
FallbackHiveAuthorizer, and override checkPrivileges.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 249689)
    Time Spent: 5h 10m  (was: 5h)

> Update HiveMetastore authorization to enable use of HiveAuthorizer 
> implementation
> ---------------------------------------------------------------------------------
>
>                 Key: HIVE-21753
>                 URL: https://issues.apache.org/jira/browse/HIVE-21753
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 3.1.2
>            Reporter: Ramesh Mani
>            Assignee: Ramesh Mani
>            Priority: Critical
>              Labels: pull-request-available
>         Attachments: HIVE-21753.1.patch, HIVE-21753.2.patch, 
> HIVE-21753.3.patch, HIVE-21753.4.patch
>
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> Currently HMS supports authorization using StorageBasedAuthorizationProvider 
> which relies on permissions at filesystem – like HDFS. Hive supports a 
> pluggable authorization interface, and multiple authorizer implementations 
> (like SQLStd, Ranger, Sentry) are available to authorizer access in Hive. 
> Extending HiveMetastore to use the same authorization interface as Hive will 
> enable use of pluggable authorization implementations; and will result in 
> consistent authorization across Hive, HMS and other services that use HMS 
> (like Spark).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to