Skip to content

Commit

Permalink
Merge pull request rabbitmq#7439 from rabbitmq/rabbitmq-server-7432
Browse files Browse the repository at this point in the history
Add documentation for hashing passwords
  • Loading branch information
michaelklishin authored Feb 27, 2023
2 parents 659f16b + dd90d64 commit 4f25779
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions deps/rabbit/docs/rabbitmqctl.8
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,14 @@ password for the user named
This user now cannot log in with a password (but may be able to through
e.g. SASL EXTERNAL if configured).
.\" ------------------------------------------------------------------
.It Cm hash_password Ar plaintext
.Bl -tag -width Ds
.It Ar plaintext
The plaintext password to hash
.El
.Pp
Hashes a plaintext password according to the currently configured password hashing algorithm
.\" ------------------------------------------------------------------
.It Cm delete_user Ar username
.Bl -tag -width Ds
.It Ar username
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ defmodule RabbitMQ.CLI.Ctl.Commands.HashPasswordCommand do

@behaviour RabbitMQ.CLI.CommandBehaviour
use RabbitMQ.CLI.Core.MergesNoDefaults
use RabbitMQ.CLI.DefaultOutput

def run([cleartextpassword], _opts) do
hash_password(cleartextpassword)
Expand Down Expand Up @@ -46,11 +45,16 @@ defmodule RabbitMQ.CLI.Ctl.Commands.HashPasswordCommand do
:ok
end

## Use default output for all non-special case outputs
use RabbitMQ.CLI.DefaultOutput

def usage, do: "hash_password <cleartext_password>"

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

def banner([], _options),
do: "Will hash provided password"

def description(), do: "Hashes a plaintext password"
end
10 changes: 10 additions & 0 deletions deps/rabbitmq_management/priv/www/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,16 @@ <h2>Reference</h2>
A list of authentication attempts by remote address and username.
</td>
</tr>
<tr>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td class="path">/api/auth/hash_password/<i>plaintext-password</i></td>
<td>
Hashes <code>plaintext-password</code> according to the currently configured password hashing algorithm.
</td>
</tr>
</table>


Expand Down

0 comments on commit 4f25779

Please sign in to comment.