Skip to content

Commit 4f25779

Browse files
Merge pull request #7439 from rabbitmq/rabbitmq-server-7432
Add documentation for hashing passwords
2 parents 659f16b + dd90d64 commit 4f25779

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

deps/rabbit/docs/rabbitmqctl.8

+8
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,14 @@ password for the user named
683683
This user now cannot log in with a password (but may be able to through
684684
e.g. SASL EXTERNAL if configured).
685685
.\" ------------------------------------------------------------------
686+
.It Cm hash_password Ar plaintext
687+
.Bl -tag -width Ds
688+
.It Ar plaintext
689+
The plaintext password to hash
690+
.El
691+
.Pp
692+
Hashes a plaintext password according to the currently configured password hashing algorithm
693+
.\" ------------------------------------------------------------------
686694
.It Cm delete_user Ar username
687695
.Bl -tag -width Ds
688696
.It Ar username

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)