[
https://issues.apache.org/jira/browse/HIVE-26248?focusedWorklogId=800200&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-800200
]
ASF GitHub Bot logged work on HIVE-26248:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Aug/22 07:37
Start Date: 12/Aug/22 07:37
Worklog Time Spent: 10m
Work Description: zhangbutao commented on code in PR #3312:
URL: https://github.com/apache/hive/pull/3312#discussion_r944193223
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterDataConnectorEvent.java:
##########
@@ -0,0 +1,91 @@
+/*
+ * 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.events;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.hive.metastore.api.DataConnector;
+import org.apache.hadoop.hive.metastore.events.PreAlterDataConnectorEvent;
+import org.apache.hadoop.hive.metastore.events.PreEventContext;
+import
org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType;
+import
org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject;
+import
org.apache.hadoop.hive.ql.security.authorization.plugin.metastore.HiveMetaStoreAuthorizableEvent;
+import
org.apache.hadoop.hive.ql.security.authorization.plugin.metastore.HiveMetaStoreAuthzInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/*
+ Authorizable Event for HiveMetaStore operation AlterDataConnector
+ */
+
+public class AlterDataConnectorEvent extends HiveMetaStoreAuthorizableEvent {
+ private static final Logger LOG =
LoggerFactory.getLogger(AlterDataConnectorEvent.class);
+
+ private String COMMAND_STR = "alter connector";
+
+ public AlterDataConnectorEvent(PreEventContext preEventContext) {
+ super(preEventContext);
+ }
+
+ @Override
+ public HiveMetaStoreAuthzInfo getAuthzContext() {
+ HiveMetaStoreAuthzInfo ret =
+ new HiveMetaStoreAuthzInfo(preEventContext,
HiveOperationType.ALTERDATACONNECTOR, getInputHObjs(),
+ getOutputHObjs(), COMMAND_STR);
+
+ return ret;
+ }
+
+ private List<HivePrivilegeObject> getInputHObjs() {
+ return Collections.emptyList();
Review Comment:
Make sense. fixed!
Issue Time Tracking
-------------------
Worklog Id: (was: 800200)
Time Spent: 1h 40m (was: 1.5h)
> Add data connector authorization on HMS server-side
> ---------------------------------------------------
>
> Key: HIVE-26248
> URL: https://issues.apache.org/jira/browse/HIVE-26248
> Project: Hive
> Issue Type: Sub-task
> Affects Versions: 4.0.0-alpha-1, 4.0.0-alpha-2
> Reporter: zhangbutao
> Assignee: zhangbutao
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)