Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-14672

Creating a user with a mixed-case username behaves strangely

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.1.1
    • None
    • ambari-server
    • None

    Description

      If you create a user with some capital letters in the username, Ambari accepts the request and creates a user with the lowercase version of that username. However, if you then do a GET on the original username, Ambari gives a 200 response but an empty response body:

      GET /api/v1/users/MixedCase
      200 OK
      <empty response>
      
      GET /api/v1/users/mixedcase
      200 OK
      {
        "href" : "https://ambari-8d6c17ae32685572aa82f82b813138a1.cbdptest.com/api/v1/users/mixedcase",
        "Users" : {
          "active" : true,
          "admin" : false,
          "groups" : [ ],
          "ldap_user" : false,
          "user_name" : "mixedcase"
        },
        "widget_layouts" : [ ],
        "privileges" : [ ]
      }
      

      Ambari should throw a 404 error at a minimum, but better yet, just lowercase the username requested and return the right user. Since we silently lowercase it on POST, we should do the same on GET, IMO.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jimbobhickville Greg Hill
            jimbobhickville Greg Hill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment