mgaido91 commented on a change in pull request #141: [LIVY-551] Add "doAs" 
impersonation support
URL: https://github.com/apache/incubator-livy/pull/141#discussion_r252155202
 
 

 ##########
 File path: 
server/src/main/scala/org/apache/livy/server/batch/BatchSession.scala
 ##########
 @@ -57,10 +57,12 @@ object BatchSession extends Logging {
       livyConf: LivyConf,
       accessManager: AccessManager,
       owner: String,
+      impersonatedUser: Option[String],
       sessionStore: SessionStore,
       mockApp: Option[SparkApp] = None): BatchSession = {
     val appTag = s"livy-batch-$id-${Random.alphanumeric.take(8).mkString}"
-    val impersonatedUser = accessManager.checkImpersonation(request.proxyUser, 
owner, livyConf)
+
+    impersonatedUser.filter(accessManager.checkImpersonation(owner, _))
 
 Review comment:
   the result of the filter is never used, so it is useless as it is now... 
Moreover it is weird that tests are passing nonetheless... may you please add a 
UT for this?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to