-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#bug fix UpdateUser API, #Improvement TemporaryPWGeneration, API Filter #47
Conversation
func TestPasswordGeneration(t *testing.T) { | ||
length := 8 | ||
sameCount := 0 | ||
for i := 0; i < 10000000; i++ { | ||
firstGenPassword := helper.GenerateRandomString(length) | ||
secondGenPassword := helper.GenerateRandomString(length) | ||
if firstGenPassword == secondGenPassword { | ||
fmt.Printf("Index: %d. It's same %s\n", i, firstGenPassword) | ||
sameCount++ | ||
} | ||
} | ||
fmt.Println("Same count: ", sameCount) | ||
fmt.Println("Same ratio: ", float64(sameCount)/100000) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert 구문은 따로 없나요?
0.0001% 미만이면 성공이라든가 그런게 필요할 것 같네요.
10000000 정도면 충분히 큰 수라서 우연히 0.0001% 이상이 나온다던가 그런 일은 없을 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 비교 구문 대신 assert를 사용하면 되나 편의상 간단히 보기 위해 이렇게 처리했어요
go test 정식 사용법은 assert()를 사용함이 맞습니다
internal.API_PREFIX + internal.API_VERSION + "/organizations/" + requestUserInfo.GetOrganizationId() + "/my-profile" + "/password", | ||
internal.API_PREFIX + internal.API_VERSION + "/organizations/" + requestUserInfo.GetOrganizationId() + "/my-profile" + "/next-password-change", | ||
internal.API_PREFIX + internal.API_VERSION + "/auth/logout", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영 감사합니다 👍
@@ -1,15 +1,11 @@ | |||
package helper | |||
|
|||
import ( | |||
"crypto/rand" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변경하기 전에는 실제로 동일한 PW 가 나오는 케이스가 발생하고 있었나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
천만과 1억도 돌려봤는데 안나왔어요. 어제 말씀해주신 케이스는 정말 신기하네요..
suffle도 넣을까 하였는데 효과 확신도 안들어 넣지 않았어요. crypto package로 변환해보는게 적절할 꺼같아 이번 건은 이렇게 처리했습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix:
Improve: