feat: secure messenger ingress and rate-limit logins

This commit is contained in:
Dmitrii Grishko
2026-11-14 19:24:51 +03:00
parent e3d7df4e72
commit 48e6a6ac0d
16 changed files with 337 additions and 76 deletions
@@ -0,0 +1,19 @@
package services
import "testing"
func BenchmarkPasswordVerification(b *testing.B) {
const password = "synthetic-benchmark-password"
hash, err := HashPassword(password)
if err != nil {
b.Fatal(err)
}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
ok, err := VerifyPassword(password, hash)
if err != nil || !ok {
b.Fatalf("verification failed: %v", err)
}
}
}