Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-499

Admin user_upsert with external type results in error due to password field being sent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.4.1
    • None
    • None
    • None

    Description

      If you use the Admin interface to insert an external user

      clusterManager.user_upsert(AuthDomain.External, 'TestExternalUser', None, [('bucket_full_access', 'travel-sample')], 'Test External User')
      

      It will error out with:

      couchbase.exceptions.HTTPError: <Key='/settings/rbac/users/external/SampleExternalUser', RC=0x3B[HTTP Operation failed. Inspect status code for details], HTTP Request failed. Examine 'objextra' for full result, Results=1, C Source=(src/http.c,144), OBJ=HttpResult<rc=0x0, value={u'errors': {u'password': u'Found unsupported key password'}}, http_status=400, url=/settings/rbac/users/external/SampleExternalUser>>
      

      When examining the HTTP requests, I see that we are sending the password field as "None" or as "" if I put "" in the call above.

      It looks like we do not check if the request is for an external user before putting the password field into the request in here https://github.com/couchbase/couchbase-python-client/blob/2d489573fa15e1998dfe8cc7c53565733f7ec71f/couchbase/admin.py#L410

      Another issue that came up is that the "_mk_formstr" function in here https://github.com/couchbase/couchbase-python-client/blob/2d489573fa15e1998dfe8cc7c53565733f7ec71f/couchbase/admin.py#L155
      should treat None differently. Looks like it is just converting it to a string and sending it as "None" in the HTTP requests.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Ellis.Breen Ellis Breen
            david.saadeh David Saadeh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty