You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/01/24 18:02:48 UTC

[GitHub] mgaido91 commented on a change in pull request #141: [LIVY-551] Add "doAs" impersonation support

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_r250716539
 
 

 ##########
 File path: server/src/main/scala/org/apache/livy/server/batch/BatchSessionServlet.scala
 ##########
 @@ -42,20 +42,24 @@ class BatchSessionServlet(
 
   override protected def createSession(req: HttpServletRequest): BatchSession = {
     val createRequest = bodyAs[CreateBatchRequest](req)
+    val owner = accessManager.getRequestUser(req)
+    val legacyProxyUser = getLegacyProxyUser(owner, createRequest.proxyUser, req)
+    val impersonatedUser = getImpersonatedUser(req).orElse(legacyProxyUser)
 
 Review comment:
   we are doing the parsing for `legacyProxyUser ` also when it is not needed, we can do:
   ```
   orElse(getLegacyProxyUser(....))
   ```

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


With regards,
Apache Git Services