Skip to content

Commit

Permalink
Implementing long username flag in HTTP connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
nousot-cloud-guy committed Jun 27, 2023
1 parent fe7477a commit 11b767b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ final class KyuubiTHttpFrontendService(
}

override protected def getRealUserAndSessionUser(req: TOpenSessionReq): (String, String) = {
val realUser = getShortName(Option(SessionManager.getUserName).getOrElse(req.getUsername))
val longUsername = conf.get(AUTHENTICATION_LONG_USERNAME)
val realUser: String =
if (longUsername)
Option(SessionManager.getUserName).getOrElse(req.getUsername)
else getShortName(Option(SessionManager.getUserName).getOrElse(req.getUsername))
// using the remote ip address instead of that in proxy http header for authentication
val ipAddress: String = SessionManager.getIpAddress
val sessionUser: String = getProxyUser(req.getConfiguration, ipAddress, realUser)
Expand Down

0 comments on commit 11b767b

Please sign in to comment.