From f9ca2c0e682043d0014562b90b4028a43710c302 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 6 Nov 2025 16:46:56 +0000 Subject: [PATCH] Add hashpw utility for generating password hashes Simple CLI utility to generate bcrypt password hashes for admin users. Usage: hashpw This utility helps administrators generate properly hashed passwords for use in configuration files or manual user setup. --- cmd/hashpw/main.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cmd/hashpw/main.go diff --git a/cmd/hashpw/main.go b/cmd/hashpw/main.go new file mode 100644 index 0000000..45557de --- /dev/null +++ b/cmd/hashpw/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "fmt" + "os" + + "github.com/rcourtman/pulse-go-rewrite/internal/auth" +) + +func main() { + if len(os.Args) < 2 { + fmt.Println("Usage: hashpw ") + os.Exit(1) + } + + password := os.Args[1] + hash, err := auth.HashPassword(password) + if err != nil { + fmt.Printf("Error: %v\n", err) + os.Exit(1) + } + + fmt.Println(hash) +}