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

ASF GitHub Bot logged work on HDDS-1246:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Mar/19 20:54
            Start Date: 14/Mar/19 20:54
    Worklog Time Spent: 10m 
      Work Description: xiaoyuyao commented on pull request #594: HDDS-1246. 
Add ozone delegation token utility subcmd for Ozone CLI. Contributed by Xiaoyu 
Yao.
URL: https://github.com/apache/hadoop/pull/594#discussion_r265761945
 
 

 ##########
 File path: 
hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/O3fsDtFetcher.java
 ##########
 @@ -0,0 +1,84 @@
+/**
+ * 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.fs.ozone;
+
+import java.io.IOException;
+import java.net.URI;
+
+import org.apache.hadoop.ozone.OzoneConsts;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.security.token.DtFetcher;
+import org.apache.hadoop.security.token.Token;
+
+
+/**
+ * A DT fetcher for OzoneFileSystem.
+ * It is only needed for the `hadoop dtutil` command.
+ */
+public class O3fsDtFetcher implements DtFetcher {
+  private static final Logger LOG =
+      LoggerFactory.getLogger(O3fsDtFetcher.class);
+
+  private static final String SERVICE_NAME = OzoneConsts.OZONE_URI_SCHEME;
+
+  private static final String FETCH_FAILED =
+      "Fetch ozone delegation token failed";
+
+  /**
+   * Returns the service name for O3fs, which is also a valid URL prefix.
+   */
+  public Text getServiceName() {
+    return new Text(SERVICE_NAME);
+  }
+
+  public boolean isTokenRequired() {
 
 Review comment:
   No, we can't. It is an implementation of DtFetcher interface method.
 
----------------------------------------------------------------
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: 213410)
    Time Spent: 3h 10m  (was: 3h)

> Add ozone delegation token utility subcmd for Ozone CLI
> -------------------------------------------------------
>
>                 Key: HDDS-1246
>                 URL: https://issues.apache.org/jira/browse/HDDS-1246
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Xiaoyu Yao
>            Assignee: Xiaoyu Yao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> This allow running dtutil with integration test and dev test for demo of 
> Ozone security.
>  
>  
>  
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to