feat: seed secure demo merchant identity

This commit is contained in:
2026-08-20 19:52:01 +03:30
parent cc7a4e4718
commit b30e3439a4
7 changed files with 296 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
package identity
import "testing"
func TestHashPasswordAndVerifyPassword(t *testing.T) {
t.Parallel()
hash, err := HashPassword("correct horse battery staple")
if err != nil {
t.Fatal(err)
}
if !VerifyPassword("correct horse battery staple", hash) {
t.Fatal("VerifyPassword() = false, want true")
}
if VerifyPassword("incorrect password", hash) {
t.Fatal("VerifyPassword() = true for incorrect password")
}
}
func TestHashPasswordRejectsShortPassword(t *testing.T) {
t.Parallel()
if _, err := HashPassword("short"); err == nil {
t.Fatal("HashPassword() error = nil, want length error")
}
}