Skip to content

Commit b52e747

Browse files
lukebakkenmergify[bot]
authored andcommitted
Add documentation for hashing passwords
Fixes #7432 Adds HTTP API documentation as well as `rabbitmqctl hash_password` docs. Add `rabbitmqctl` docs (cherry picked from commit f420487) (cherry picked from commit 7efd584) (cherry picked from commit 1e49ff3)
1 parent 7e2d4a9 commit b52e747

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

deps/rabbit/docs/rabbitmqctl.8

+9
Original file line numberDiff line numberDiff line change
@@ -2222,6 +2222,15 @@ The name of the queue to purge.
22222222
.Pp
22232223
Purges a queue (removes all messages in it).
22242224
.El
2225+
.\" ------------------------------------------------------------------
2226+
.It Cm hash_password Ar plaintext
2227+
.Bl -tag -width Ds
2228+
.It Ar plaintext
2229+
The plaintext password to hash
2230+
.El
2231+
.Pp
2232+
Hashes a plaintext password according to the currently configured password hashing algorithm
2233+
.El
22252234
.\" ------------------------------------------------------------------------------------------------
22262235
.Sh PLUGIN COMMANDS
22272236
.\" ------------------------------------------------------------------------------------------------

deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/hash_password_command.ex

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ defmodule RabbitMQ.CLI.Ctl.Commands.HashPasswordCommand do
99

1010
@behaviour RabbitMQ.CLI.CommandBehaviour
1111
use RabbitMQ.CLI.Core.MergesNoDefaults
12-
use RabbitMQ.CLI.DefaultOutput
1312

1413
def run([cleartextpassword], _opts) do
1514
hash_password(cleartextpassword)
@@ -46,11 +45,16 @@ defmodule RabbitMQ.CLI.Ctl.Commands.HashPasswordCommand do
4645
:ok
4746
end
4847

48+
## Use default output for all non-special case outputs
49+
use RabbitMQ.CLI.DefaultOutput
50+
4951
def usage, do: "hash_password <cleartext_password>"
5052

5153
def banner([arg], _options),
5254
do: "Will hash password #{arg}"
5355

5456
def banner([], _options),
5557
do: "Will hash provided password"
58+
59+
def description(), do: "Hashes a plaintext password"
5660
end

deps/rabbitmq_management/priv/www/api/index.html

+10
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,16 @@ <h2>Reference</h2>
11571157
A list of authentication attempts by remote address and username.
11581158
</td>
11591159
</tr>
1160+
<tr>
1161+
<td>X</td>
1162+
<td></td>
1163+
<td></td>
1164+
<td></td>
1165+
<td class="path">/api/auth/hash_password/<i>plaintext-password</i></td>
1166+
<td>
1167+
Hashes <code>plaintext-password</code> according to the currently configured password hashing algorithm.
1168+
</td>
1169+
</tr>
11601170
</table>
11611171

11621172

0 commit comments

Comments
 (0)