Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-7055 YARN Timeline Service v.2: beta 1
  3. YARN-6989

Ensure timeline service v2 codebase gets UGI from HttpServletRequest in a consistent way

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.10.0, 3.0.4, 3.1.2, 3.2.1
    • Component/s: timelineserver
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      As noticed during discussions in YARN-6820, the webservices in timeline service v2 get the UGI created from the user obtained by invoking getRemoteUser on the HttpServletRequest .

      It will be good to use getUserPrincipal instead of invoking getRemoteUser on the HttpServletRequest.

      Filing jira to update the code.

      Per Java EE documentations for 6 and 7, the behavior around getRemoteUser and getUserPrincipal is listed at:

      http://docs.oracle.com/javaee/6/tutorial/doc/gjiie.html#bncba
      https://docs.oracle.com/javaee/7/tutorial/security-webtier003.htm

      getRemoteUser, which determines the user name with which the client authenticated. The getRemoteUser method returns the name of the remote user (the caller) associated by the container with the request. If no user has been authenticated, this method returns null.
      
      getUserPrincipal, which determines the principal name of the current user and returns a java.security.Principal object. If no user has been authenticated, this method returns null. Calling the getName method on the Principal returned by getUserPrincipal returns the name of the remote user.
      

        Attachments

        1. YARN-6989.001.patch
          2 kB
          Abhishek Modi
        2. YARN-6989.002.patch
          3 kB
          Abhishek Modi

          Issue Links

            Activity

              People

              • Assignee:
                abmodi Abhishek Modi
                Reporter:
                vrushalic Vrushali C
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: