← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1603905] Re: V2 API: enable a user doesn't work

 

Reviewed:  https://review.openstack.org/344057
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=4adf01b03b75af4bb1917f545dc71788fb07d5ea
Submitter: Jenkins
Branch:    master

commit 4adf01b03b75af4bb1917f545dc71788fb07d5ea
Author: Dave Chen <wei.d.chen@xxxxxxxxx>
Date:   Tue Jul 19 14:53:36 2016 +0800

    Add schema for enabling a user
    
    The schema is added to ensure the payload is correctly assembled.
    
    The route of the API is defined here:
    https://github.com/openstack/keystone/blob/master/keystone/v2_crud/admin_crud.py#L134
    
    Partially implements: bp schema-validation-extent
    Change-Id: I79c95be3699cf915fc8542d2e770072970656261
    Closes-Bug: #1603905


** Changed in: keystone
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1603905

Title:
  V2 API: enable a user doesn't work

Status in OpenStack Identity (keystone):
  Fix Released

Bug description:
  Enable user
  ===========
  PUT /v2.0/users/{userId}/OS-KSADM/enabled

  The above API doesn't work, there are two issue here.

  1. The API unnecessarily need a request body

  url -g -i -X PUT
  http://10.239.159.68/identity_v2_admin/v2.0/users/acc163d0efa14fe5b84e1dcc62ff6404
  /OS-KSADM/enabled  -H "Content-Type: application/json" -H "Accept:
  application/json" -H "X-Auth-Token: e2fde9a73eb743e298e3d10aabebe5e0"

  {"error": {"message": "set_user_enabled() takes exactly 4 arguments (3
  given)", "code": 400, "title": "Bad Request"}}

  2. If we pass a request body without 'enabled' property, it cannot
  enable the disabled user.

  openstack user show acc163d0efa14fe5b84e1dcc62ff6404
  +--------------------+----------------------------------+
  | Field              | Value                            |
  +--------------------+----------------------------------+
  | default_project_id | e9b5b0575cad498f8fce9e39ef209411 |
  | domain_id          | default                          |
  | enabled            | False                            |
  | id                 | acc163d0efa14fe5b84e1dcc62ff6404 |
  | name               | test_user                        |
  +--------------------+----------------------------------+

  curl -g -i -X PUT
  http://10.239.159.68/identity_v2_admin/v2.0/users/acc163d0efa14fe5b84e1dcc62ff6404
  /OS-KSADM/enabled  -H "Content-Type: application/json" -H "Accept:
  application/json" -H "X-Auth-Token: e2fde9a73eb743e298e3d10aabebe5e0"
  -d '{"user": {"name": "test_user"}}'

  {"user": {"username": "test_user", "name": "test_user", "extra": {},
  "enabled": false, "id": "acc163d0efa14fe5b84e1dcc62ff6404",
  "tenantId": "e9b5b0575cad498f8fce9e39ef209411"}}

  Nothing is changed, the user is still disabled.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1603905/+subscriptions


References