From 0648f5e93a40f3a055cdf69c90338d10b88ab908 Mon Sep 17 00:00:00 2001 From: Venkatesh Sridharan Date: Mon, 29 Apr 2019 12:19:19 -0500 Subject: [PATCH 1/6] Add method to FsDelegation token to accept token kind --- .../security/token/FsDelegationToken.java | 39 +++++++- .../security/token/TestFsDelegationToken.java | 95 +++++++++++++++++++ 2 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java index 389bcc6be9ee..603743681db7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java @@ -20,6 +20,11 @@ import java.io.IOException; +import java.util.Objects; +import org.apache.hadoop.hdfs.protocol.HdfsConstants; +import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; +import org.apache.hadoop.hdfs.web.SWebHdfsFileSystem; +import org.apache.hadoop.hdfs.web.WebHdfsFileSystem; import org.apache.yetus.audience.InterfaceAudience; import org.apache.yetus.audience.InterfaceStability; import org.slf4j.Logger; @@ -54,18 +59,46 @@ public FsDelegationToken(final UserProvider userProvider, final String renewer) } /** - * Acquire the delegation token for the specified filesytem. + * Acquire the delegation token for the specified filesystem. * Before requesting a new delegation token, tries to find one already available. + * Currently supports checking existing delegation tokens for swebhdfs, webhdfs and hdfs. * * @param fs the filesystem that requires the delegation token * @throws IOException on fs.getDelegationToken() failure */ public void acquireDelegationToken(final FileSystem fs) throws IOException { + String tokenKind; + String scheme = fs.getUri().getScheme(); + if (SWebHdfsFileSystem.SCHEME.equalsIgnoreCase(scheme)) { + tokenKind = SWebHdfsFileSystem.TOKEN_KIND.toString(); + } else if (WebHdfsFileSystem.SCHEME.equalsIgnoreCase(scheme)) { + tokenKind = WebHdfsFileSystem.TOKEN_KIND.toString(); + } else if (HdfsConstants.HDFS_URI_SCHEME.equalsIgnoreCase(scheme)) { + tokenKind = DelegationTokenIdentifier.HDFS_DELEGATION_KIND.toString(); + } else { + LOG.warn("Unknown FS URI scheme: " + scheme); + // Preserve default behavior + tokenKind = DelegationTokenIdentifier.HDFS_DELEGATION_KIND.toString(); + } + + acquireDelegationToken(tokenKind, fs); + } + + /** + * Acquire the delegation token for the specified filesystem and token kind. + * Before requesting a new delegation token, tries to find one already available. + * + * @param tokenKind non-null token kind to get delegation token from the {@link UserProvider} + * @param fs the filesystem that requires the delegation token + * @throws IOException on fs.getDelegationToken() failure + */ + public void acquireDelegationToken(final String tokenKind, final FileSystem fs) + throws IOException { + Objects.requireNonNull(tokenKind, "tokenKind:null"); if (userProvider.isHadoopSecurityEnabled()) { this.fs = fs; - userToken = userProvider.getCurrent().getToken("HDFS_DELEGATION_TOKEN", - fs.getCanonicalServiceName()); + userToken = userProvider.getCurrent().getToken(tokenKind, fs.getCanonicalServiceName()); if (userToken == null) { hasForwardedToken = false; try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java new file mode 100644 index 000000000000..9dc02e0ed728 --- /dev/null +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java @@ -0,0 +1,95 @@ +package org.apache.hadoop.hbase.security.token; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.hbase.security.User; +import org.apache.hadoop.hbase.security.UserProvider; +import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; +import org.apache.hadoop.hdfs.web.SWebHdfsFileSystem; +import org.apache.hadoop.hdfs.web.WebHdfsFileSystem; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.security.token.Token; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; + +public class TestFsDelegationToken { + private UserProvider userProvider = Mockito.mock(UserProvider.class); + private User user = Mockito.mock(User.class); + private FsDelegationToken fsDelegationToken = new FsDelegationToken(userProvider, "renewer"); + private Token hdfsToken = Mockito.mock(Token.class); + private Token webhdfsToken = Mockito.mock(Token.class); + private Token swebhdfsToken = Mockito.mock(Token.class); + private WebHdfsFileSystem webHdfsFileSystem = Mockito.mock(WebHdfsFileSystem.class); + private WebHdfsFileSystem swebHdfsFileSystem = Mockito.mock(SWebHdfsFileSystem.class); + private FileSystem fileSystem = Mockito.mock(FileSystem.class); + + @Before + public void setup() throws IOException, URISyntaxException { + when(userProvider.getCurrent()).thenReturn(user); + when(userProvider.isHadoopSecurityEnabled()).thenReturn(true); + when(fileSystem.getCanonicalServiceName()).thenReturn("hdfs://"); + when(fileSystem.getUri()).thenReturn(new URI("hdfs://someUri")); + when(webHdfsFileSystem.getCanonicalServiceName()).thenReturn("webhdfs://"); + when(webHdfsFileSystem.getUri()).thenReturn(new URI("webhdfs://someUri")); + when(swebHdfsFileSystem.getCanonicalServiceName()).thenReturn("swebhdfs://"); + when(swebHdfsFileSystem.getUri()).thenReturn(new URI("swebhdfs://someUri")); + when(user.getToken(DelegationTokenIdentifier.HDFS_DELEGATION_KIND.toString(), + fileSystem.getCanonicalServiceName())) + .thenReturn(hdfsToken); + when(user.getToken( + WebHdfsFileSystem.TOKEN_KIND.toString(), + webHdfsFileSystem.getCanonicalServiceName())).thenReturn(webhdfsToken); + when(user.getToken( + SWebHdfsFileSystem.TOKEN_KIND.toString(), + swebHdfsFileSystem.getCanonicalServiceName())).thenReturn(swebhdfsToken); + when(hdfsToken.getKind()).thenReturn(new Text("HDFS_DELEGATION_TOKEN")); + when(webhdfsToken.getKind()).thenReturn(WebHdfsFileSystem.TOKEN_KIND); + when(swebhdfsToken.getKind()).thenReturn(SWebHdfsFileSystem.TOKEN_KIND); + } + + @Test + public void acquireDelegationToken_defaults_to_hdfsFileSystem() throws IOException { + fsDelegationToken.acquireDelegationToken(fileSystem); + assertEquals( + fsDelegationToken.getUserToken().getKind(), DelegationTokenIdentifier.HDFS_DELEGATION_KIND); + } + + @Test + public void acquireDelegationToken_webhdfsFileSystem() throws IOException { + fsDelegationToken.acquireDelegationToken(webHdfsFileSystem); + assertEquals( + fsDelegationToken.getUserToken().getKind(), WebHdfsFileSystem.TOKEN_KIND); + } + + @Test + public void acquireDelegationToken_swebhdfsFileSystem() throws IOException { + fsDelegationToken.acquireDelegationToken(swebHdfsFileSystem); + assertEquals( + fsDelegationToken.getUserToken().getKind(), SWebHdfsFileSystem.TOKEN_KIND); + } + + @Test(expected = NullPointerException.class) + public void acquireDelegationTokenByTokenKind_rejects_null_token_kind() throws IOException { + fsDelegationToken.acquireDelegationToken(null, fileSystem); + } + + @Test + public void acquireDelegationTokenByTokenKind_webhdfsFileSystem() throws IOException { + fsDelegationToken + .acquireDelegationToken(WebHdfsFileSystem.TOKEN_KIND.toString(), webHdfsFileSystem); + assertEquals(fsDelegationToken.getUserToken().getKind(), WebHdfsFileSystem.TOKEN_KIND); + } + + @Test + public void acquireDelegationTokenByTokenKind_swebhdfsFileSystem() throws IOException { + fsDelegationToken + .acquireDelegationToken(SWebHdfsFileSystem.TOKEN_KIND.toString(), swebHdfsFileSystem); + assertEquals(fsDelegationToken.getUserToken().getKind(), SWebHdfsFileSystem.TOKEN_KIND); + } +} From 5620da847a3d9d48ec7bfa871d9143f730086645 Mon Sep 17 00:00:00 2001 From: Venkatesh Sridharan Date: Fri, 7 Jun 2019 15:36:00 -0500 Subject: [PATCH 2/6] Adding Test categories and rules --- .../hbase/security/token/TestFsDelegationToken.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java index 9dc02e0ed728..071985580b3b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java @@ -7,17 +7,23 @@ import java.net.URI; import java.net.URISyntaxException; import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.security.UserProvider; +import org.apache.hadoop.hbase.testclassification.SecurityTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; import org.apache.hadoop.hdfs.web.SWebHdfsFileSystem; import org.apache.hadoop.hdfs.web.WebHdfsFileSystem; import org.apache.hadoop.io.Text; import org.apache.hadoop.security.token.Token; import org.junit.Before; +import org.junit.ClassRule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.mockito.Mockito; +@Category({ SecurityTests.class, SmallTests.class }) public class TestFsDelegationToken { private UserProvider userProvider = Mockito.mock(UserProvider.class); private User user = Mockito.mock(User.class); @@ -29,6 +35,10 @@ public class TestFsDelegationToken { private WebHdfsFileSystem swebHdfsFileSystem = Mockito.mock(SWebHdfsFileSystem.class); private FileSystem fileSystem = Mockito.mock(FileSystem.class); + @ClassRule + public static final HBaseClassTestRule CLASS_RULE = + HBaseClassTestRule.forClass(TestFsDelegationToken.class); + @Before public void setup() throws IOException, URISyntaxException { when(userProvider.getCurrent()).thenReturn(user); From 06603c5635892a5a0665bebca562ec7988c42d36 Mon Sep 17 00:00:00 2001 From: Venkatesh Sridharan Date: Fri, 7 Jun 2019 16:35:06 -0500 Subject: [PATCH 3/6] Test changes --- .../hadoop/hbase/security/token/TestFsDelegationToken.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java index 071985580b3b..1700a0d2d8a2 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java @@ -27,7 +27,7 @@ public class TestFsDelegationToken { private UserProvider userProvider = Mockito.mock(UserProvider.class); private User user = Mockito.mock(User.class); - private FsDelegationToken fsDelegationToken = new FsDelegationToken(userProvider, "renewer"); + private FsDelegationToken fsDelegationToken = new FsDelegationToken(userProvider, "testRenewer"); private Token hdfsToken = Mockito.mock(Token.class); private Token webhdfsToken = Mockito.mock(Token.class); private Token swebhdfsToken = Mockito.mock(Token.class); From 8e53d8f33d2b84b584b7fae301f684dc3a2b1566 Mon Sep 17 00:00:00 2001 From: Venkatesh Sridharan Date: Fri, 7 Jun 2019 17:55:52 -0500 Subject: [PATCH 4/6] Rebase with master and fix errors --- .../security/token/FsDelegationToken.java | 32 ++++++++++--------- .../security/token/TestFsDelegationToken.java | 32 +++++++++++-------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java index 603743681db7..b54ab2af64b1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java @@ -18,20 +18,22 @@ package org.apache.hadoop.hbase.security.token; -import java.io.IOException; +import static org.apache.hadoop.hdfs.protocol.HdfsConstants.HDFS_URI_SCHEME; +import static org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.HDFS_DELEGATION_KIND; +import static org.apache.hadoop.hdfs.web.WebHdfsConstants.SWEBHDFS_SCHEME; +import static org.apache.hadoop.hdfs.web.WebHdfsConstants.SWEBHDFS_TOKEN_KIND; +import static org.apache.hadoop.hdfs.web.WebHdfsConstants.WEBHDFS_SCHEME; +import static org.apache.hadoop.hdfs.web.WebHdfsConstants.WEBHDFS_TOKEN_KIND; +import java.io.IOException; import java.util.Objects; -import org.apache.hadoop.hdfs.protocol.HdfsConstants; -import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; -import org.apache.hadoop.hdfs.web.SWebHdfsFileSystem; -import org.apache.hadoop.hdfs.web.WebHdfsFileSystem; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.hbase.security.UserProvider; +import org.apache.hadoop.security.token.Token; import org.apache.yetus.audience.InterfaceAudience; import org.apache.yetus.audience.InterfaceStability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.hbase.security.UserProvider; -import org.apache.hadoop.security.token.Token; /** * Helper class to obtain a filesystem delegation token. @@ -70,16 +72,16 @@ public void acquireDelegationToken(final FileSystem fs) throws IOException { String tokenKind; String scheme = fs.getUri().getScheme(); - if (SWebHdfsFileSystem.SCHEME.equalsIgnoreCase(scheme)) { - tokenKind = SWebHdfsFileSystem.TOKEN_KIND.toString(); - } else if (WebHdfsFileSystem.SCHEME.equalsIgnoreCase(scheme)) { - tokenKind = WebHdfsFileSystem.TOKEN_KIND.toString(); - } else if (HdfsConstants.HDFS_URI_SCHEME.equalsIgnoreCase(scheme)) { - tokenKind = DelegationTokenIdentifier.HDFS_DELEGATION_KIND.toString(); + if (SWEBHDFS_SCHEME.equalsIgnoreCase(scheme)) { + tokenKind = SWEBHDFS_TOKEN_KIND.toString(); + } else if (WEBHDFS_SCHEME.equalsIgnoreCase(scheme)) { + tokenKind = WEBHDFS_TOKEN_KIND.toString(); + } else if (HDFS_URI_SCHEME.equalsIgnoreCase(scheme)) { + tokenKind = HDFS_DELEGATION_KIND.toString(); } else { LOG.warn("Unknown FS URI scheme: " + scheme); // Preserve default behavior - tokenKind = DelegationTokenIdentifier.HDFS_DELEGATION_KIND.toString(); + tokenKind = HDFS_DELEGATION_KIND.toString(); } acquireDelegationToken(tokenKind, fs); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java index 1700a0d2d8a2..0350861ee469 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java @@ -1,5 +1,8 @@ package org.apache.hadoop.hbase.security.token; +import static org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.HDFS_DELEGATION_KIND; +import static org.apache.hadoop.hdfs.web.WebHdfsConstants.SWEBHDFS_TOKEN_KIND; +import static org.apache.hadoop.hdfs.web.WebHdfsConstants.WEBHDFS_TOKEN_KIND; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; @@ -12,7 +15,6 @@ import org.apache.hadoop.hbase.security.UserProvider; import org.apache.hadoop.hbase.testclassification.SecurityTests; import org.apache.hadoop.hbase.testclassification.SmallTests; -import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; import org.apache.hadoop.hdfs.web.SWebHdfsFileSystem; import org.apache.hadoop.hdfs.web.WebHdfsFileSystem; import org.apache.hadoop.io.Text; @@ -23,7 +25,7 @@ import org.junit.experimental.categories.Category; import org.mockito.Mockito; -@Category({ SecurityTests.class, SmallTests.class }) +@Category({SecurityTests.class, SmallTests.class}) public class TestFsDelegationToken { private UserProvider userProvider = Mockito.mock(UserProvider.class); private User user = Mockito.mock(User.class); @@ -49,39 +51,40 @@ public void setup() throws IOException, URISyntaxException { when(webHdfsFileSystem.getUri()).thenReturn(new URI("webhdfs://someUri")); when(swebHdfsFileSystem.getCanonicalServiceName()).thenReturn("swebhdfs://"); when(swebHdfsFileSystem.getUri()).thenReturn(new URI("swebhdfs://someUri")); - when(user.getToken(DelegationTokenIdentifier.HDFS_DELEGATION_KIND.toString(), + when(user.getToken( + HDFS_DELEGATION_KIND.toString(), fileSystem.getCanonicalServiceName())) .thenReturn(hdfsToken); when(user.getToken( - WebHdfsFileSystem.TOKEN_KIND.toString(), + WEBHDFS_TOKEN_KIND.toString(), webHdfsFileSystem.getCanonicalServiceName())).thenReturn(webhdfsToken); when(user.getToken( - SWebHdfsFileSystem.TOKEN_KIND.toString(), + SWEBHDFS_TOKEN_KIND.toString(), swebHdfsFileSystem.getCanonicalServiceName())).thenReturn(swebhdfsToken); when(hdfsToken.getKind()).thenReturn(new Text("HDFS_DELEGATION_TOKEN")); - when(webhdfsToken.getKind()).thenReturn(WebHdfsFileSystem.TOKEN_KIND); - when(swebhdfsToken.getKind()).thenReturn(SWebHdfsFileSystem.TOKEN_KIND); + when(webhdfsToken.getKind()).thenReturn(WEBHDFS_TOKEN_KIND); + when(swebhdfsToken.getKind()).thenReturn(SWEBHDFS_TOKEN_KIND); } @Test public void acquireDelegationToken_defaults_to_hdfsFileSystem() throws IOException { fsDelegationToken.acquireDelegationToken(fileSystem); assertEquals( - fsDelegationToken.getUserToken().getKind(), DelegationTokenIdentifier.HDFS_DELEGATION_KIND); + fsDelegationToken.getUserToken().getKind(), HDFS_DELEGATION_KIND); } @Test public void acquireDelegationToken_webhdfsFileSystem() throws IOException { fsDelegationToken.acquireDelegationToken(webHdfsFileSystem); assertEquals( - fsDelegationToken.getUserToken().getKind(), WebHdfsFileSystem.TOKEN_KIND); + fsDelegationToken.getUserToken().getKind(), WEBHDFS_TOKEN_KIND); } @Test public void acquireDelegationToken_swebhdfsFileSystem() throws IOException { fsDelegationToken.acquireDelegationToken(swebHdfsFileSystem); assertEquals( - fsDelegationToken.getUserToken().getKind(), SWebHdfsFileSystem.TOKEN_KIND); + fsDelegationToken.getUserToken().getKind(), SWEBHDFS_TOKEN_KIND); } @Test(expected = NullPointerException.class) @@ -92,14 +95,15 @@ public void acquireDelegationTokenByTokenKind_rejects_null_token_kind() throws I @Test public void acquireDelegationTokenByTokenKind_webhdfsFileSystem() throws IOException { fsDelegationToken - .acquireDelegationToken(WebHdfsFileSystem.TOKEN_KIND.toString(), webHdfsFileSystem); - assertEquals(fsDelegationToken.getUserToken().getKind(), WebHdfsFileSystem.TOKEN_KIND); + .acquireDelegationToken(WEBHDFS_TOKEN_KIND.toString(), webHdfsFileSystem); + assertEquals(fsDelegationToken.getUserToken().getKind(), WEBHDFS_TOKEN_KIND); } @Test public void acquireDelegationTokenByTokenKind_swebhdfsFileSystem() throws IOException { fsDelegationToken - .acquireDelegationToken(SWebHdfsFileSystem.TOKEN_KIND.toString(), swebHdfsFileSystem); - assertEquals(fsDelegationToken.getUserToken().getKind(), SWebHdfsFileSystem.TOKEN_KIND); + .acquireDelegationToken( + SWEBHDFS_TOKEN_KIND.toString(), swebHdfsFileSystem); + assertEquals(fsDelegationToken.getUserToken().getKind(), SWEBHDFS_TOKEN_KIND); } } From b32a856142e96c329f9e751344f41a62e2a52511 Mon Sep 17 00:00:00 2001 From: Venkatesh Sridharan Date: Mon, 10 Jun 2019 10:48:22 -0500 Subject: [PATCH 5/6] Adding license statements --- .../hbase/security/token/FsDelegationToken.java | 3 +-- .../security/token/TestFsDelegationToken.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java index b54ab2af64b1..9a58006343e6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/token/FsDelegationToken.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.hadoop.hbase.security.token; import static org.apache.hadoop.hdfs.protocol.HdfsConstants.HDFS_URI_SCHEME; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java index 0350861ee469..302d84868cc3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java @@ -1,3 +1,20 @@ +/* + * 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.hbase.security.token; import static org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.HDFS_DELEGATION_KIND; From ddddcafade0d982e7e688b7ed36191f5f5e4de00 Mon Sep 17 00:00:00 2001 From: Venkatesh Sridharan Date: Mon, 10 Jun 2019 16:23:47 -0500 Subject: [PATCH 6/6] Go back to renewer in tests --- .../hadoop/hbase/security/token/TestFsDelegationToken.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java index 302d84868cc3..81347c741153 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestFsDelegationToken.java @@ -46,7 +46,7 @@ public class TestFsDelegationToken { private UserProvider userProvider = Mockito.mock(UserProvider.class); private User user = Mockito.mock(User.class); - private FsDelegationToken fsDelegationToken = new FsDelegationToken(userProvider, "testRenewer"); + private FsDelegationToken fsDelegationToken = new FsDelegationToken(userProvider, "Renewer"); private Token hdfsToken = Mockito.mock(Token.class); private Token webhdfsToken = Mockito.mock(Token.class); private Token swebhdfsToken = Mockito.mock(Token.class);