Skip to content

Commit 173e680

Browse files
committed
DOCS: Add password_hash & refresh to Put User API (#35574)
PR #35242 formalised support for the password_hash field in the body of the Put User security API. Since this field is now validated and tested, it can also be documented. The Put User API also supports a "refresh" query parameter that was not documented. This commit adds it to the docs.
1 parent 92331fd commit 173e680

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

x-pack/docs/en/rest-api/security/create-users.asciidoc

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ printable symbols in the https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_bloc
3535

3636
--
3737

38+
==== Query Parameters
39+
40+
`refresh`::
41+
(string) One of `true`, `false`, or `wait_for`.
42+
These values have the same meaning as in the <<docs-refresh, Index API>>,
43+
but the default value for this API (Put User) is `true`.
3844

3945
==== Request Body
4046

@@ -52,8 +58,26 @@ The following parameters can be specified in the body of a POST or PUT request:
5258
`metadata`::
5359
(object) Arbitrary metadata that you want to associate with the user.
5460

55-
`password` (required)::
56-
(string) The user's password. Passwords must be at least 6 characters long.
61+
`password` ::
62+
(string) The user's password. Passwords must be at least 6 characters long.
63+
+
64+
When adding a user, one of `password` or `password_hash` is required.
65+
When updating an existing user, the password is optional, so that other
66+
fields on the user (such as their roles) may be updated without modifying
67+
the user's password.
68+
69+
`password_hash` ::
70+
(string) A _hash_ of the user's password. This must be produced using the
71+
same hashing algorithm as has been configured for password storage. For more
72+
details, see the explanation of the
73+
`xpack.security.authc.password_hashing.algorithm` setting in
74+
<<hashing-settings>>.
75+
+
76+
Using this parameter allows the client to pre-hash the password for
77+
performance and/or confidentiality reasons.
78+
+
79+
The `password` parameter and the `password_hash` parameter cannot be
80+
used in the same request.
5781

5882
`roles` (required)::
5983
(list) A set of roles the user has. The roles determine the user's access

0 commit comments

Comments
 (0)