Skip to content

Add documentation for hashing passwords #7439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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