dongjoon-hyun commented on a change in pull request #23511: [SPARK-26592][SS]
Throw exception when kafka delegation token tried to obtain with proxy user
URL: https://github.com/apache/spark/pull/23511#discussion_r247003068
##########
File path:
core/src/test/scala/org/apache/spark/deploy/security/KafkaTokenUtilSuite.scala
##########
@@ -78,6 +79,19 @@ class KafkaTokenUtilSuite extends SparkFunSuite with
BeforeAndAfterEach {
Configuration.setConfiguration(null)
}
+ test("checkProxyUser with proxy current user should throw exception") {
+ val currentUser = UserGroupInformation.getCurrentUser()
+ val savedAuthenticationMethod = currentUser.getAuthenticationMethod()
+ try {
+
currentUser.setAuthenticationMethod(UserGroupInformation.AuthenticationMethod.PROXY)
+ intercept[IllegalArgumentException] {
+ KafkaTokenUtil.checkProxyUser()
+ }
Review comment:
Please check the explicit error message. We need to make it sure that the
correct `IllegalArgumentException` is thrown since there are many
`IllegalArgumentException` cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]