From 3664286506f673737c0784b9cfd494cda1dc4618 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 19 May 2022 22:44:33 -0600 Subject: Actually use the auth middleware for assets routes --- srv/src/cmd/hash-password/main.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 srv/src/cmd/hash-password/main.go (limited to 'srv/src/cmd/hash-password') diff --git a/srv/src/cmd/hash-password/main.go b/srv/src/cmd/hash-password/main.go new file mode 100644 index 0000000..b787a4d --- /dev/null +++ b/srv/src/cmd/hash-password/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "bufio" + "fmt" + "os" + "strings" + + "github.com/mediocregopher/blog.mediocregopher.com/srv/api" +) + +func main() { + + fmt.Fprint(os.Stderr, "Password: ") + + line, err := bufio.NewReader(os.Stdin).ReadString('\n') + + if err != nil { + panic(err) + } + + fmt.Println(api.NewPasswordHash(strings.TrimSpace(line))) +} -- cgit v1.2.3