v2 api: add APIs for setting a user's password
Add support for an admin setting a user's password, the route is defined here: https://github.com/openstack/keystone/blob/master/keystone/v2_crud/admin_crud.py#L110-L114 Also, this patch updates the sample response and sample request for enabling a user, since the two APIs are very similar. Change-Id: I3ad0d4ab8ebec7481954997cd0b127627a18f13d
This commit is contained in:
parent
df30ac6efc
commit
7f7cfe7b7e
@ -28,7 +28,49 @@ Request
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: samples/OS-KSADM/userwithenabledonly-enable-request.json
|
||||
.. literalinclude:: samples/OS-KSADM/user-set-enabled-request.json
|
||||
:language: javascript
|
||||
|
||||
Response Parameters
|
||||
-------------------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- email: email
|
||||
- enabled: enabled
|
||||
- id: id
|
||||
- name: name
|
||||
- username: username
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/OS-KSADM/user-show-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
Set user password
|
||||
=================
|
||||
|
||||
.. rest_method:: PUT /v2.0/users/{userId}/OS-KSADM/password
|
||||
|
||||
Sets a user's password
|
||||
|
||||
Normal response codes: 200
|
||||
Error response codes: 413,415,405,404,403,401,400,503,409
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
.. rest_parameters:: parameters.yaml
|
||||
|
||||
- userId: userId
|
||||
- password: new_password
|
||||
|
||||
Request Example
|
||||
---------------
|
||||
|
||||
.. literalinclude:: samples/OS-KSADM/user-set-password-request.json
|
||||
:language: javascript
|
||||
|
||||
Response Parameters
|
||||
@ -40,11 +82,12 @@ Response Parameters
|
||||
- email: email
|
||||
- name: name
|
||||
- id: id
|
||||
- username: username
|
||||
|
||||
Response Example
|
||||
----------------
|
||||
|
||||
.. literalinclude:: samples/OS-KSADM/userwithenabledonly-show-response.json
|
||||
.. literalinclude:: samples/OS-KSADM/user-show-response.json
|
||||
:language: javascript
|
||||
|
||||
|
||||
|
@ -175,6 +175,12 @@ user:
|
||||
in: body
|
||||
required: true
|
||||
type: string
|
||||
username:
|
||||
description: |
|
||||
The user name.
|
||||
in: body
|
||||
required: false
|
||||
type: string
|
||||
users:
|
||||
description: |
|
||||
The ``users`` object.
|
||||
@ -186,4 +192,4 @@ users_links:
|
||||
The links of ``users`` object.
|
||||
in: body
|
||||
required: true
|
||||
type: array
|
||||
type: array
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"user": {
|
||||
"password": "new_password"
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"user": {
|
||||
"id": "3c9530e",
|
||||
"name": "admin",
|
||||
"email": "admin@example.org",
|
||||
"username": "admin",
|
||||
"enabled": true
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"user": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user