← Back to team overview

yahoo-eng-team team mailing list archive

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

 

Public bug reported:

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 cannot
enable the 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.

** Affects: keystone
     Importance: Undecided
         Status: New

** Description changed:

  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.
+ 2. If we pass a request body without 'enabled' property, it cannot
+ enable the 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: 
+ 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.
+ Nothing is changed, the user is still disabled.

-- 
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):
  New

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:

  {"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 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


Follow ups