Merge pull request #8895 from ioito/hotfix/qx-password-check

fix(region): 避免OneCloud密码校验通过,公有云厂商密码校验不通过
This commit is contained in:
yunion-ci-robot
2020-11-25 09:58:15 +08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ func AnalyzePasswordStrenth(passwd string) PasswordStrength {
ps.Lowercases += 1
} else if strings.IndexByte(ALL_UPPERS, passwd[i]) >= 0 {
ps.Uppercases += 1
} else if strings.IndexByte(ALL_PUNC, passwd[i]) >= 0 {
} else if strings.IndexByte(PUNC, passwd[i]) >= 0 {
ps.Punctuats += 1
}
}
+2 -1
View File
@@ -31,7 +31,8 @@ func TestMeetComplxity(t *testing.T) {
want bool
}{
{"123456", false},
{"123abcABC!@#", true},
{"123abcABC!@#", false},
{"123abcABC-@=", true},
}
for _, c := range cases {
if c.want != MeetComplxity(c.in) {