S3-вложения и сверка Postgresql с MinIO

This commit is contained in:
2026-11-13 19:15:04 +03:00
parent ec540a1a72
commit 79e94f9d2a
60 changed files with 6702 additions and 50 deletions
+23
View File
@@ -0,0 +1,23 @@
package password
import "testing"
func TestArgon2idRoundTrip(t *testing.T) {
p := Params{Time: 1, Memory: 8, Threads: 1}
encoded, err := p.Hash("correct-horse-1")
if err != nil {
t.Fatal(err)
}
if encoded == "correct-horse-1" || len(encoded) < 20 {
t.Fatalf("hash is not a PHC string: %s", encoded)
}
if !Verify("correct-horse-1", encoded) {
t.Fatal("matching password rejected")
}
if Verify("other-password-1", encoded) {
t.Fatal("wrong password accepted")
}
if Verify("correct-horse-1", "sha256:deadbeef") {
t.Fatal("non-argon string accepted")
}
}