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/02/01 10:02:49 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_r252990909
 
 

 ##########
 File path: server/src/main/scala/org/apache/livy/server/SessionServlet.scala
 ##########
 @@ -160,6 +160,30 @@ abstract class SessionServlet[S <: Session, R <: RecoveryMetadata](
    */
   protected def remoteUser(req: HttpServletRequest): String = req.getRemoteUser()
 
+  /**
+   * Returns the impersonated user as given by "doAs" as a request parameter.
+   */
+  protected def impersonatedUser(request: HttpServletRequest): Option[String] = {
+    Option(request.getParameter("doAs"))
+  }
+
+  /**
+   * Returns the proxyUser for the given request.
+   */
+  protected def proxyUser(request: HttpServletRequest,
 
 Review comment:
   nit: parameter on newline

----------------------------------------------------------------
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