Instrument durable messenger with OTel, provision Grafana and prove SLO incident detection
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package messenger
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPasswordFullUnicodeRange(t *testing.T) {
|
||||
password := strings.Repeat("🙂", 128) // 512 bytes: exceeds bcrypt's 72-byte limit.
|
||||
hash := hashPassword(password)
|
||||
if !verifyPassword(password, hash) || verifyPassword(password+"x", hash) {
|
||||
t.Fatal("password mismatch")
|
||||
}
|
||||
if hash == hashPassword(password) {
|
||||
t.Fatal("salt reused")
|
||||
}
|
||||
if verifyPassword(password, "$argon2id$v=19$m=999999999,t=3,p=2$abc$def") {
|
||||
t.Fatal("unbounded parameters accepted")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user