diff options
author | Sorabh Hamirwasia <shamirwasia@maprtech.com> | 2018-03-21 15:53:25 -0700 |
---|---|---|
committer | Vitalii Diravka <vitalii.diravka@gmail.com> | 2018-03-26 13:02:57 +0300 |
commit | 36aa757911b3953b1edc864e585015e06b1d5dfd (patch) | |
tree | 8c2c12739f8be40823391a1c1903999c0f4d5132 /exec/java-exec/src/test/java/org/apache/drill/exec/server | |
parent | a8c46445a6febd21d19ca1338003d65df072dc18 (diff) |
DRILL-6283: WebServer stores SPNEGO client principal without taking any conversion rule
closes #1180
Diffstat (limited to 'exec/java-exec/src/test/java/org/apache/drill/exec/server')
-rw-r--r-- | exec/java-exec/src/test/java/org/apache/drill/exec/server/rest/spnego/TestSpnegoAuthentication.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/server/rest/spnego/TestSpnegoAuthentication.java b/exec/java-exec/src/test/java/org/apache/drill/exec/server/rest/spnego/TestSpnegoAuthentication.java index 14253e229..65ea56146 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/exec/server/rest/spnego/TestSpnegoAuthentication.java +++ b/exec/java-exec/src/test/java/org/apache/drill/exec/server/rest/spnego/TestSpnegoAuthentication.java @@ -253,7 +253,7 @@ public class TestSpnegoAuthentication { // Create client subject using it's principal and keytab final Subject clientSubject = JaasKrbUtil.loginUsingKeytab(spnegoHelper.CLIENT_PRINCIPAL, - spnegoHelper.clientKeytab.getAbsoluteFile()); + spnegoHelper.clientKeytab.getAbsoluteFile()); // Generate a SPNEGO token for the peer SERVER_PRINCIPAL from this CLIENT_PRINCIPAL final String token = Subject.doAs(clientSubject, new PrivilegedExceptionAction<String>() { @@ -284,19 +284,19 @@ public class TestSpnegoAuthentication { // Create a DrillbitContext with service principal and keytab for DrillSpnegoLoginService final DrillConfig newConfig = new DrillConfig(DrillConfig.create() - .withValue(ExecConstants.HTTP_AUTHENTICATION_MECHANISMS, - ConfigValueFactory.fromIterable(Lists.newArrayList("spnego"))) - .withValue(ExecConstants.HTTP_SPNEGO_PRINCIPAL, - ConfigValueFactory.fromAnyRef(spnegoHelper.SERVER_PRINCIPAL)) - .withValue(ExecConstants.HTTP_SPNEGO_KEYTAB, - ConfigValueFactory.fromAnyRef(spnegoHelper.serverKeytab.toString()))); + .withValue(ExecConstants.HTTP_AUTHENTICATION_MECHANISMS, + ConfigValueFactory.fromIterable(Lists.newArrayList("spnego"))) + .withValue(ExecConstants.HTTP_SPNEGO_PRINCIPAL, + ConfigValueFactory.fromAnyRef(spnegoHelper.SERVER_PRINCIPAL)) + .withValue(ExecConstants.HTTP_SPNEGO_KEYTAB, + ConfigValueFactory.fromAnyRef(spnegoHelper.serverKeytab.toString()))); final SystemOptionManager optionManager = Mockito.mock(SystemOptionManager.class); Mockito.when(optionManager.getOption(ExecConstants.ADMIN_USERS_VALIDATOR)) - .thenReturn(ExecConstants.ADMIN_USERS_VALIDATOR.DEFAULT_ADMIN_USERS); + .thenReturn(ExecConstants.ADMIN_USERS_VALIDATOR.DEFAULT_ADMIN_USERS); Mockito.when(optionManager.getOption(ExecConstants.ADMIN_USER_GROUPS_VALIDATOR)) - .thenReturn(ExecConstants.ADMIN_USER_GROUPS_VALIDATOR.DEFAULT_ADMIN_USER_GROUPS); + .thenReturn(ExecConstants.ADMIN_USER_GROUPS_VALIDATOR.DEFAULT_ADMIN_USER_GROUPS); final DrillbitContext drillbitContext = Mockito.mock(DrillbitContext.class); Mockito.when(drillbitContext.getConfig()).thenReturn(newConfig); @@ -309,7 +309,7 @@ public class TestSpnegoAuthentication { // Validate the UserIdentity of authenticated client assertTrue(user != null); - assertTrue(user.getUserPrincipal().getName().equals(spnegoHelper.CLIENT_PRINCIPAL)); + assertTrue(user.getUserPrincipal().getName().equals(spnegoHelper.CLIENT_SHORT_NAME)); assertTrue(user.isUserInRole("authenticated", null)); } |