From 8370ee1eb7610d5ecd9e4e5d2b49c6d36820f427 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Mon, 29 Jun 2026 00:28:54 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4=E8=AF=AF=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E4=B8=80=E6=AC=A1=E6=80=A7=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6(tmphash=20/=20zz=5Ftmpverify=5Ftest)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P1 提交时 git add -A 误带入早期改密码调试残留(注释自标「临时,不提交」)。 --- server/cmd/tmphash/main.go | 27 ----------------------- server/internal/auth/zz_tmpverify_test.go | 10 --------- 2 files changed, 37 deletions(-) delete mode 100644 server/cmd/tmphash/main.go delete mode 100644 server/internal/auth/zz_tmpverify_test.go diff --git a/server/cmd/tmphash/main.go b/server/cmd/tmphash/main.go deleted file mode 100644 index cc987de..0000000 --- a/server/cmd/tmphash/main.go +++ /dev/null @@ -1,27 +0,0 @@ -// tmphash — 一次性:按服务端 argon2id 参数算密码 hash(临时,不提交)。 -package main - -import ( - "crypto/rand" - "encoding/base64" - "fmt" - "os" - - "golang.org/x/crypto/argon2" -) - -func main() { - pw := "wangjia812" - if len(os.Args) > 1 { - pw = os.Args[1] - } - salt := make([]byte, 16) - if _, err := rand.Read(salt); err != nil { - panic(err) - } - key := argon2.IDKey([]byte(pw), salt, uint32(1), uint32(65536), uint8(4), uint32(32)) - fmt.Printf("$argon2id$v=%d$m=%d,t=%d,p=%d$%s$%s\n", - argon2.Version, 65536, 1, 4, - base64.RawStdEncoding.EncodeToString(salt), - base64.RawStdEncoding.EncodeToString(key)) -} diff --git a/server/internal/auth/zz_tmpverify_test.go b/server/internal/auth/zz_tmpverify_test.go deleted file mode 100644 index 0a88415..0000000 --- a/server/internal/auth/zz_tmpverify_test.go +++ /dev/null @@ -1,10 +0,0 @@ -package auth -import "testing" -import "os" -func TestTmpVerify(t *testing.T){ - h,_ := os.ReadFile("/Users/wangjia/.claude/jobs/f76e813b/tmp/newhash.txt") - enc := string(h); enc = enc[:len(enc)-1] // strip newline - ok,err := VerifyPassword(enc, "wangjia812") - if err!=nil || !ok { t.Fatalf("verify failed ok=%v err=%v", ok, err) } - t.Log("verify OK") -}