Comment 0 for bug 1603905

Revision history for this message
Dave Chen (wei-d-chen) wrote :

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:

{"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 could make the user enabled.

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:

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

Nothing changed, the user is still disabled.