about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbin/__dispatch.sh3
l---------bin/hash-password1
-rw-r--r--tools/hash-password.nix7
3 files changed, 11 insertions, 0 deletions
diff --git a/bin/__dispatch.sh b/bin/__dispatch.sh
index ad559fe96255..ce10f13370d1 100755
--- a/bin/__dispatch.sh
+++ b/bin/__dispatch.sh
@@ -49,6 +49,9 @@ case "${TARGET_TOOL}" in
   gerrit)
     attr="tools.gerrit-cli"
     ;;
+  hash-password)
+    attr="tools.hash-password"
+    ;;
   *)
     echo "The tool '${TARGET_TOOL}' is currently not installed in this repository."
     exit 1
diff --git a/bin/hash-password b/bin/hash-password
new file mode 120000
index 000000000000..8390ec9c9652
--- /dev/null
+++ b/bin/hash-password
@@ -0,0 +1 @@
+__dispatch.sh
\ No newline at end of file
diff --git a/tools/hash-password.nix b/tools/hash-password.nix
new file mode 100644
index 000000000000..9893d521787e
--- /dev/null
+++ b/tools/hash-password.nix
@@ -0,0 +1,7 @@
+# Utility for invoking slappasswd with the correct options for
+# creating an ARGON2 password hash.
+{ pkgs, ... }:
+
+pkgs.writeShellScriptBin "hash-password" ''
+  ${pkgs.openldap}/bin/slappasswd -o module-load=pw-argon2 -h '{ARGON2}'
+''