aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/security/testing/UserAuthenticatorTestImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/security/testing/UserAuthenticatorTestImpl.java')
-rw-r--r--exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/security/testing/UserAuthenticatorTestImpl.java29
1 files changed, 24 insertions, 5 deletions
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/security/testing/UserAuthenticatorTestImpl.java b/exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/security/testing/UserAuthenticatorTestImpl.java
index 7cfab5ffd..e65eca51f 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/security/testing/UserAuthenticatorTestImpl.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/rpc/user/security/testing/UserAuthenticatorTestImpl.java
@@ -18,6 +18,7 @@
package org.apache.drill.exec.rpc.user.security.testing;
import org.apache.drill.common.config.DrillConfig;
+import org.apache.drill.exec.impersonation.TestInboundImpersonation;
import org.apache.drill.exec.exception.DrillbitStartupException;
import org.apache.drill.exec.rpc.user.security.UserAuthenticationException;
import org.apache.drill.exec.rpc.user.security.UserAuthenticator;
@@ -27,9 +28,17 @@ import org.apache.hadoop.security.UserGroupInformation;
import java.io.IOException;
-/*
- * Implement {@link org.apache.drill.exec.rpc.user.security.UserAuthenticator} for testing UserAuthenticator and
- * authentication of users from Java client to Drillbit.
+import static org.apache.drill.exec.impersonation.TestInboundImpersonation.PROXY_NAME;
+import static org.apache.drill.exec.impersonation.TestInboundImpersonation.PROXY_PASSWORD;
+import static org.apache.drill.exec.impersonation.TestInboundImpersonation.TARGET_NAME;
+import static org.apache.drill.exec.impersonation.TestInboundImpersonation.TARGET_PASSWORD;
+import static org.apache.drill.exec.impersonation.TestInboundImpersonation.OWNER;
+import static org.apache.drill.exec.impersonation.TestInboundImpersonation.OWNER_PASSWORD;
+
+/**
+ * Implement {@link org.apache.drill.exec.rpc.user.security.UserAuthenticator} for testing:
+ * + UserAuthenticator and authentication of users from Java client to Drillbit.
+ * + {@link TestInboundImpersonation user delegation}.
*/
@UserAuthenticatorTemplate(type = UserAuthenticatorTestImpl.TYPE)
public class UserAuthenticatorTestImpl implements UserAuthenticator {
@@ -65,10 +74,20 @@ public class UserAuthenticatorTestImpl implements UserAuthenticator {
return;
}
- if (!(TEST_USER_1.equals(user) && TEST_USER_1_PASSWORD.equals(password)) &&
+ if (
+ !(PROCESS_USER.equals(user) && PROCESS_USER_PASSWORD.equals(password)) &&
+ /**
+ * Used in {@link org.apache.drill.exec.rpc.user.security.TestCustomUserAuthenticator}
+ */
+ !(TEST_USER_1.equals(user) && TEST_USER_1_PASSWORD.equals(password)) &&
!(TEST_USER_2.equals(user) && TEST_USER_2_PASSWORD.equals(password)) &&
!(ADMIN_USER.equals(user) && ADMIN_USER_PASSWORD.equals(password)) &&
- !(PROCESS_USER.equals(user) && PROCESS_USER_PASSWORD.equals(password))) {
+ /**
+ * Used in {@link TestInboundImpersonation}
+ */
+ !(OWNER.equals(user) && OWNER_PASSWORD.equals(password)) &&
+ !(TARGET_NAME.equals(user) && TARGET_PASSWORD.equals(password)) &&
+ !(PROXY_NAME.equals(user) && PROXY_PASSWORD.equals(password))) {
throw new UserAuthenticationException();
}
}